home *** CD-ROM | disk | FTP | other *** search
/ PC Open 97 / PC Open 97 CD2.bin / Demo / FileMaker / Data1.cab / Detail.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2003-12-15  |  142.6 KB  |  3,970 lines

  1. <?xml version="1.0"?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3.     <xsl:import href="Strings.xsl"/>
  4.     <xsl:output method="html" doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" encoding="UTF-8" indent="yes"/>    
  5.     
  6.     <!-- Indexing for cross referencing -->
  7.     <xsl:key name="BaseTable-TableAliasIndex" match="RelationshipGraph/TableList/Table" use="@name"/>    
  8.     <xsl:key name="TableAlias-BaseTableIndex" match="RelationshipGraph/TableList/Table" use="@baseTable"/>            
  9.     <xsl:key name="Relationship-LeftTableAliasIndex" match="RelationshipGraph/RelationshipList/Relationship" use="LeftTable/@name"/>
  10.     <xsl:key name="Relationship-RightTableAliasIndex" match="RelationshipGraph/RelationshipList/Relationship" use="RightTable/@name"/>    
  11.     
  12.     <!-- Template for generating the main report. The main entry point for the transformation. -->
  13.     <xsl:template name="MainReport" match="/">
  14.         <html>
  15.             <head>                
  16.                 <title>
  17.                     <xsl:value-of select="File/@name"/>
  18.                 </title>
  19.                 <link href="{$valReportCSS}" type="text/css" rel="stylesheet"/>
  20.             </head>    
  21.             <body>        
  22.                 <xsl:call-template name="Table-Overview">
  23.                     <xsl:with-param name="inFile" select="FMPReport/File"/>
  24.                 </xsl:call-template>
  25.                 <!-- Construct the overview table -->                    
  26.                 <xsl:apply-templates/>
  27.             </body>
  28.             
  29.         </html>
  30.     </xsl:template>
  31.  
  32.     <xsl:template name="ReplaceString">
  33.         <xsl:param name="inputString"/>
  34.         <xsl:param name="findString"/>
  35.         <xsl:param name="replaceString"/>
  36.         
  37.         <xsl:choose>
  38.             <xsl:when test="contains($inputString, $findString)">
  39.                 <xsl:value-of select="concat(substring-before($inputString, $findString), $replaceString)"/>
  40.                 <xsl:call-template name="ReplaceString">
  41.                     <xsl:with-param name="inputString" select="substring-after($inputString, $findString)"/>
  42.                     <xsl:with-param name="findString" select="$findString"/>
  43.                     <xsl:with-param name="replaceString" select="$replaceString"/>
  44.                 </xsl:call-template>                
  45.             </xsl:when>
  46.             <xsl:otherwise>
  47.                 <xsl:value-of select="$inputString"/>
  48.             </xsl:otherwise>
  49.         </xsl:choose>
  50.     </xsl:template>
  51.     <!-- Below are templates for generating different sections of the report -->        
  52.     <xsl:template name="Link-WithAnchor">
  53.         <xsl:param name="inAnchor"/>
  54.         <xsl:param name="inDisplayText"/>
  55.         <xsl:text disable-output-escaping="yes">
  56.             <a href="
  57.         </xsl:text>
  58.         <xsl:value-of select="$inAnchor"/>
  59.             <xsl:text disable-output-escaping="yes">
  60.             ">
  61.         </xsl:text>
  62.         <xsl:value-of select="$inDisplayText"/>
  63.         <xsl:text disable-output-escaping="yes">
  64.             </a>
  65.         </xsl:text>
  66.     </xsl:template>        
  67.     
  68.     <xsl:template name="AnchorPoint">
  69.         <xsl:param name="inAnchor"/>
  70.         <xsl:param name="inDisplayText"/>
  71.         <xsl:text disable-output-escaping="yes"><a name="</xsl:text><xsl:value-of select="$inAnchor"/><xsl:text disable-output-escaping="yes">"/></xsl:text><xsl:value-of select="$inDisplayText"/>        
  72.     </xsl:template>
  73.     
  74.     <xsl:template name="ItalicAnchorPoint">
  75.         <xsl:param name="inAnchor"/>
  76.         <xsl:param name="inDisplayText"/>
  77.         <xsl:text disable-output-escaping="yes"><a name="</xsl:text><xsl:value-of select="$inAnchor"/><xsl:text disable-output-escaping="yes">"/><em></xsl:text><xsl:value-of select="$inDisplayText"/><xsl:text disable-output-escaping="yes"></em></xsl:text>
  78.     </xsl:template>
  79.     
  80.     <xsl:template name="TableAnchorPoint">
  81.         <xsl:param name="inAnchor"/>
  82.         <xsl:param name="inDisplayText"/>
  83.         <xsl:text disable-output-escaping="yes"><a name="</xsl:text><xsl:value-of select="$inAnchor"/><xsl:text disable-output-escaping="yes">"/></xsl:text><xsl:text disable-output-escaping="yes"><em></xsl:text><xsl:value-of select="$inDisplayText"/><xsl:text disable-output-escaping="yes"></em></xsl:text>
  84.     </xsl:template>
  85.     
  86.     <xsl:template name="ItalicLink-WithAnchor">
  87.         <xsl:param name="inAnchor"/>
  88.         <xsl:param name="inDisplayText"/>
  89.         <xsl:text disable-output-escaping="yes">
  90.             <a href="
  91.         </xsl:text>
  92.         <xsl:value-of select="$inAnchor"/>
  93.             <xsl:text disable-output-escaping="yes">
  94.             "><em>
  95.         </xsl:text>
  96.         <xsl:value-of select="$inDisplayText"/>
  97.         <xsl:text disable-output-escaping="yes">
  98.             </em></a>
  99.         </xsl:text>
  100.     </xsl:template>
  101.     
  102.     <xsl:template name="FullFieldLink-WithAnchor">
  103.         <xsl:param name="inAnchor"/>
  104.         <xsl:param name="inTableName"/>
  105.         <xsl:param name="inFieldName"/>
  106.         <xsl:text disable-output-escaping="yes">
  107.             <a href="
  108.         </xsl:text>
  109.         <xsl:value-of select="$inAnchor"/>
  110.         <xsl:text disable-output-escaping="yes">
  111.             "><em>
  112.         </xsl:text>
  113.         <xsl:value-of select="$inTableName"/>
  114.         <xsl:text disable-output-escaping="yes">
  115.             </em>
  116.         </xsl:text><xsl:value-of select="concat('::',$inFieldName)"/>
  117.         <xsl:text disable-output-escaping="yes">
  118.             </a>
  119.         </xsl:text>            
  120.     </xsl:template>
  121.     
  122.     <!-- Section reference. -->
  123.     <xsl:template name="SectionReference">
  124.         <xsl:param name="inSection"/>
  125.         <xsl:param name="inCount"/>
  126.         <xsl:choose>
  127.             <xsl:when test="$inCount > 0">
  128.                 <xsl:call-template name="Link-WithAnchor">
  129.                     <xsl:with-param name="inAnchor" select="concat('#',$inSection, $kAnchorSection)"/>
  130.                     <xsl:with-param name="inDisplayText" select="$inCount"/>
  131.                 </xsl:call-template>
  132.             </xsl:when>
  133.             <xsl:otherwise>
  134.                 <xsl:value-of select="$inCount"/>
  135.             </xsl:otherwise>
  136.         </xsl:choose>
  137.     </xsl:template>
  138.     
  139.     <!--FieldDefinition reference: must pass a Field node under the BaseTable node! -->
  140.     <xsl:template name="FieldDefinitionReference">
  141.         <xsl:param name="inFieldDefinition"/>                
  142.         <xsl:call-template name="FullFieldLink-WithAnchor">
  143.             <xsl:with-param name="inAnchor" select="concat('#',$inFieldDefinition/ancestor::BaseTable/@name, $inFieldDefinition/@name, $kAnchorField)"/>
  144.             <xsl:with-param name="inTableName" select="$inFieldDefinition/ancestor::BaseTable/@name"/>
  145.             <xsl:with-param name="inFieldName" select="$inFieldDefinition/@name"/>
  146.         </xsl:call-template>                                        
  147.     </xsl:template>
  148.     
  149.     <!-- Field reference: must pass a Field node! -->
  150.     <xsl:template name="FieldReference-ShowTableAlias">
  151.         <xsl:param name="inField"/>        
  152.         <xsl:variable name="tableAlias" select="/FMPReport/File/RelationshipGraph/TableList/Table[@name = $inField/@table]"/>
  153.         <xsl:variable name="fileReference" select="/FMPReport/File/FileReferenceCatalog/FileReference[@name = $tableAlias/FileReference/@name]"/>        
  154.         <xsl:choose>
  155.             <xsl:when test="$tableAlias">                
  156.                 <xsl:choose>
  157.                     <xsl:when test="$tableAlias/FileReference">
  158.                         <xsl:choose>
  159.                             <xsl:when test="$fileReference/@link">                                
  160.                                 <xsl:call-template name="FullFieldLink-WithAnchor">
  161.                                     <xsl:with-param name="inAnchor" select="concat($fileReference/@link,'#',$tableAlias/@baseTable, $inField/@name, $kAnchorField)"/>
  162.                                     <xsl:with-param name="inTableName" select="$inField/@table"/>
  163.                                     <xsl:with-param name="inFieldName" select="$inField/@name"/>
  164.                                 </xsl:call-template>                                                            
  165.                             </xsl:when>
  166.                             <xsl:otherwise>
  167.                                 <em><xsl:value-of select="$inField/@table"/></em><xsl:value-of select="concat('::', $inField/@name)"/>
  168.                             </xsl:otherwise>
  169.                         </xsl:choose>                        
  170.                     </xsl:when>
  171.                     <xsl:otherwise>                                                        
  172.                         <xsl:call-template name="FullFieldLink-WithAnchor">
  173.                             <xsl:with-param name="inAnchor" select="concat('#',$tableAlias/@baseTable, $inField/@name, $kAnchorField)"/>
  174.                             <xsl:with-param name="inTableName" select="$inField/@table"/>
  175.                             <xsl:with-param name="inFieldName" select="$inField/@name"/>
  176.                         </xsl:call-template>
  177.                     </xsl:otherwise>
  178.                 </xsl:choose>
  179.             </xsl:when>
  180.             <xsl:otherwise>
  181.                 <em><xsl:value-of select="$inField/@table"/></em><xsl:value-of select="concat('::', $inField/@name)"/>                    
  182.             </xsl:otherwise>
  183.         </xsl:choose>                    
  184.     </xsl:template>
  185.     
  186.     <xsl:template name="FieldReference-ShowBaseTable">
  187.         <xsl:param name="inField"/>        
  188.         <xsl:variable name="tableAlias" select="/FMPReport/File/RelationshipGraph/TableList/Table[@name = $inField/@table]"/>
  189.         <xsl:variable name="fileReference" select="/FMPReport/File/FileReferenceCatalog/FileReference[@name = $tableAlias/FileReference/@name]"/>
  190.         <xsl:choose>
  191.             <xsl:when test="$tableAlias">
  192.                 <xsl:choose>
  193.                     <xsl:when test="$tableAlias/FileReference">
  194.                         <xsl:choose>
  195.                             <xsl:when test="$fileReference/@link">
  196.                                 <xsl:call-template name="Link-WithAnchor">
  197.                                     <xsl:with-param name="inAnchor" select="concat($fileReference/@link,'#',$tableAlias/@baseTable, $inField/@name,$kAnchorField)"/>
  198.                                     <xsl:with-param name="inDisplayText" select="concat($tableAlias/@baseTable, '::', $inField/@name)"/>
  199.                                 </xsl:call-template>                                
  200.                             </xsl:when>
  201.                             <xsl:otherwise>
  202.                                 <xsl:value-of select="$inField/@name"/>
  203.                             </xsl:otherwise>
  204.                         </xsl:choose>
  205.                     </xsl:when>
  206.                     <xsl:otherwise>
  207.                         <xsl:call-template name="Link-WithAnchor">
  208.                             <xsl:with-param name="inAnchor" select="concat('#',$tableAlias/@baseTable, $inField/@name, $kAnchorField)"/>
  209.                             <xsl:with-param name="inDisplayText" select="concat($tableAlias/@baseTable, '::', $inField/@name)"/>
  210.                         </xsl:call-template>                                                
  211.                     </xsl:otherwise>
  212.                 </xsl:choose>
  213.             </xsl:when>
  214.             <xsl:otherwise>
  215.                 <xsl:value-of select="$inField/@name"/>
  216.             </xsl:otherwise>
  217.         </xsl:choose>            
  218.     </xsl:template>
  219.     
  220.     <xsl:template name="FieldReference-ShowFieldNameOnly">
  221.         <xsl:param name="inField"/>        
  222.         <xsl:variable name="tableAlias" select="/FMPReport/File/RelationshipGraph/TableList/Table[@name = $inField/@table]"/>
  223.         <xsl:variable name="fileReference" select="/FMPReport/File/FileReferenceCatalog/FileReference[@name = $tableAlias/FileReference/@name]"/>
  224.         <xsl:choose>
  225.             <xsl:when test="$tableAlias">
  226.                 <xsl:choose>
  227.                     <xsl:when test="$tableAlias/FileReference">
  228.                         <xsl:choose>
  229.                             <xsl:when test="$fileReference/@link">
  230.                                 <xsl:call-template name="Link-WithAnchor">
  231.                                     <xsl:with-param name="inAnchor" select="concat($fileReference/@link,'#', $tableAlias/@baseTable, $inField/@name,$kAnchorField)"/>
  232.                                     <xsl:with-param name="inDisplayText" select="$inField/@name"/>
  233.                                 </xsl:call-template>                                
  234.                             </xsl:when>
  235.                             <xsl:otherwise>
  236.                                 <xsl:value-of select="$inField/@name"/>
  237.                             </xsl:otherwise>
  238.                         </xsl:choose>
  239.                     </xsl:when>
  240.                     <xsl:otherwise>
  241.                         <xsl:call-template name="Link-WithAnchor">
  242.                             <xsl:with-param name="inAnchor" select="concat('#',$tableAlias/@baseTable, $inField/@name, $kAnchorField)"/>
  243.                             <xsl:with-param name="inDisplayText" select="$inField/@name"/>
  244.                         </xsl:call-template>                        
  245.                     </xsl:otherwise>
  246.                 </xsl:choose>
  247.             </xsl:when>
  248.             <xsl:otherwise>
  249.                 <xsl:value-of select="$inField/@name"/>
  250.             </xsl:otherwise>
  251.         </xsl:choose>            
  252.     </xsl:template>    
  253.     
  254.     <!-- BaseTable reference: must pass a BaseTable name!-->    
  255.     <xsl:template name="BaseTableReference">
  256.         <xsl:param name="inBaseTable"/>        
  257.         <xsl:variable name="baseTable" select="/FMPReport/File/BaseTableCatalog/BaseTable[@name = $inBaseTable]"/>
  258.         <!-- Check to see if there is a BaseTable node under BaseTableCatalog! -->
  259.         <xsl:choose>
  260.             <xsl:when test="$baseTable">
  261.                 <xsl:call-template name="Link-WithAnchor">
  262.                     <xsl:with-param name="inAnchor" select="concat('#',$inBaseTable, $kAnchorBaseTable)"/>
  263.                     <xsl:with-param name="inDisplayText" select="$inBaseTable"/>
  264.                 </xsl:call-template>                    
  265.             </xsl:when>
  266.             <xsl:otherwise>
  267.                 <xsl:value-of select="$inBaseTable"/>
  268.             </xsl:otherwise>
  269.         </xsl:choose>
  270.     </xsl:template>
  271.     
  272.     <!--TableAlias reference: must pass a Table node! -->
  273.     <xsl:template name="TableAliasReference">
  274.         <xsl:param name="inTableAlias"/>    
  275.         <xsl:choose>        
  276.             <xsl:when test="$inTableAlias/FileReference">
  277.                 <xsl:variable name="fileRef" select="/FMPReport/File/FileReferenceCatalog/FileReference[@name=$inTableAlias/FileReference/@name]"/>
  278.                 <xsl:choose>
  279.                     <xsl:when test="$fileRef/@link">
  280.                         <xsl:call-template name="ItalicLink-WithAnchor">
  281.                             <xsl:with-param name="inAnchor" select="concat($fileRef/@link, '#',$inTableAlias/@name, $kAnchorTable)"/>
  282.                             <xsl:with-param name="inDisplayText" select="$inTableAlias/@name"/>
  283.                         </xsl:call-template>                    
  284.                     </xsl:when>
  285.                     <xsl:otherwise>
  286.                         <em><xsl:value-of select="$inTableAlias/@name"/></em>
  287.                     </xsl:otherwise>
  288.                 </xsl:choose>
  289.             </xsl:when>
  290.             <xsl:otherwise>    
  291.                 <xsl:call-template name="ItalicLink-WithAnchor">
  292.                     <xsl:with-param name="inAnchor" select="concat('#', $inTableAlias/@name, $kAnchorTable)"/>
  293.                     <xsl:with-param name="inDisplayText" select="$inTableAlias/@name"/>
  294.                 </xsl:call-template>                
  295.             </xsl:otherwise>
  296.         </xsl:choose>
  297.     </xsl:template>
  298.     
  299.     <!--Base table reference given a table alias/occurrence -->
  300.     <xsl:template name="BaseTableRefGivenTableAlias">
  301.         <xsl:param name="inTableAlias"/>
  302.         <xsl:choose>
  303.             <!-- External base table references -->
  304.             <xsl:when test="$inTableAlias/FileReference">
  305.                 <xsl:variable name="fileRef" select="/FMPReport/File/FileReferenceCatalog/FileReference[@name = $inTableAlias/FileReference/@name]"/>
  306.                 <xsl:choose>
  307.                     <xsl:when test="$fileRef/@link">
  308.                         <xsl:call-template name="Link-WithAnchor">
  309.                             <xsl:with-param name="inAnchor" select="concat($fileRef/@link,'#', $inTableAlias/@baseTable,$kAnchorBaseTable)"/>
  310.                             <xsl:with-param name="inDisplayText" select="$inTableAlias/@baseTable"/>
  311.                         </xsl:call-template>                        
  312.                     </xsl:when>
  313.                     <xsl:otherwise>
  314.                         <xsl:value-of select="$inTableAlias/@baseTable"/>
  315.                     </xsl:otherwise>
  316.                 </xsl:choose>
  317.             </xsl:when>
  318.             <xsl:otherwise>
  319.                 <!-- Internal references -->
  320.                 <xsl:call-template name="BaseTableReference">
  321.                     <xsl:with-param name="inBaseTable" select="$inTableAlias/@baseTable"/>
  322.                 </xsl:call-template>
  323.             </xsl:otherwise>
  324.         </xsl:choose>
  325.     </xsl:template>
  326.     
  327.     
  328.     <!-- File Reference references -->
  329.     <xsl:template name="FileRefReference">
  330.         <xsl:param name="inFileReference"/>
  331.         <xsl:variable name="fileRef" select="/FMPReport/File/FileReferenceCatalog/FileReference[@name=$inFileReference/@name]"/>
  332.         <xsl:choose>
  333.             <xsl:when test="$fileRef">
  334.                 <xsl:call-template name="Link-WithAnchor">
  335.                     <xsl:with-param name="inAnchor" select="concat('#', $inFileReference/@name, $kAnchorFileReference)"/>
  336.                     <xsl:with-param name="inDisplayText" select="$inFileReference/@name"/>
  337.                 </xsl:call-template>                
  338.             </xsl:when>
  339.             <xsl:otherwise>
  340.                 <xsl:value-of select="$inFileReference/@name"/>
  341.             </xsl:otherwise>
  342.         </xsl:choose>
  343.     </xsl:template>
  344.     
  345.     <xsl:template name="FileRefAnchor">
  346.         <xsl:param name="inFileReference"/>
  347.         <xsl:call-template name="AnchorPoint">
  348.             <xsl:with-param name="inAnchor" select="concat($inFileReference/@name, $kAnchorFileReference)"/>
  349.             <xsl:with-param name="inDisplayText" select="$inFileReference/@name"/>
  350.         </xsl:call-template>        
  351.     </xsl:template>
  352.     
  353.     <!--Layout reference: must pass a Layout node! -->
  354.     <xsl:template name="LayoutReference">
  355.         <xsl:param name="inLayout"/>
  356.         <xsl:choose>
  357.             <xsl:when test="/FMPReport/File/LayoutCatalog/Layout[(@name = $inLayout/@name) and (@id = $inLayout/@id)]">    
  358.                 <xsl:call-template name="Link-WithAnchor">
  359.                     <xsl:with-param name="inAnchor" select="concat('#',$inLayout/@name, $inLayout/@id, $kAnchorLayout)"/>
  360.                     <xsl:with-param name="inDisplayText" select="$inLayout/@name"/>
  361.                 </xsl:call-template>                
  362.             </xsl:when>
  363.             <xsl:otherwise>
  364.                 <xsl:value-of select="$inLayout/@name"/>
  365.             </xsl:otherwise>
  366.         </xsl:choose>    
  367.     </xsl:template>
  368.     
  369.     <!--Value list reference: must pass a ValueList node! -->
  370.     <xsl:template name="VLReference">
  371.         <xsl:param name="inVL"/>
  372.         <xsl:choose>
  373.             <xsl:when test="/FMPReport/File/ValueListCatalog/ValueList[@name = $inVL/@name]">
  374.                 <xsl:call-template name="Link-WithAnchor">
  375.                     <xsl:with-param name="inAnchor" select="concat('#',$inVL/@name, $kAnchorVL)"/>
  376.                     <xsl:with-param name="inDisplayText" select="$inVL/@name"/>
  377.                 </xsl:call-template>                
  378.             </xsl:when>
  379.             <xsl:otherwise>
  380.                 <xsl:value-of select="$inVL/@name"/>
  381.             </xsl:otherwise>
  382.         </xsl:choose>                            
  383.     </xsl:template>
  384.     
  385.     <xsl:template name="VLAnchor">
  386.         <xsl:param name="inVL"/>
  387.         <xsl:call-template name="AnchorPoint">
  388.             <xsl:with-param name="inAnchor" select="concat($inVL/@name, $kAnchorVL)"/>
  389.             <xsl:with-param name="inDisplayText" select="$inVL/@name"/>
  390.         </xsl:call-template>        
  391.     </xsl:template>
  392.     
  393.     <!--External value list reference: must pass a ValueList and FileReference node! -->
  394.     <xsl:template name="ExternalVLReference">
  395.         <xsl:param name="inExternalVL"/>
  396.         <xsl:param name="inFileRef"/>        
  397.         <xsl:variable name="fileRef" select="/FMPReport/File/FileReferenceCatalog/FileReference[@name=$inFileRef/@name]"/>
  398.         <xsl:choose>
  399.             <xsl:when test="$fileRef/@link">
  400.                 <xsl:call-template name="Link-WithAnchor">
  401.                     <xsl:with-param name="inAnchor" select="concat($fileRef/@link,'#', $inExternalVL/@name,$kAnchorVL)"/>
  402.                     <xsl:with-param name="inDisplayText" select="$inExternalVL/@name"/>
  403.                 </xsl:call-template>                
  404.             </xsl:when>
  405.             <xsl:otherwise><xsl:value-of select="$inExternalVL/@name"/></xsl:otherwise>
  406.         </xsl:choose>        
  407.     </xsl:template>
  408.     
  409.     <!--Script reference: must pass a Script node! -->
  410.     <xsl:template name="ScriptReference">
  411.         <xsl:param name="inScript"/>
  412.         <xsl:choose>
  413.             <xsl:when test="/FMPReport/File/ScriptCatalog/Script[(@name = $inScript/@name) and (@id = $inScript/@id)]">
  414.                 <xsl:call-template name="Link-WithAnchor">
  415.                     <xsl:with-param name="inAnchor" select="concat('#', $inScript/@name, $inScript/@id, $kAnchorScript)"/>
  416.                     <xsl:with-param name="inDisplayText" select="$inScript/@name"/>
  417.                 </xsl:call-template>                
  418.             </xsl:when>
  419.             <xsl:otherwise>
  420.                 <xsl:value-of select="$inScript/@name"/>
  421.             </xsl:otherwise>    
  422.         </xsl:choose>
  423.     </xsl:template>
  424.     
  425.     <xsl:template name="ExternalScriptReference">
  426.         <xsl:param name="inFileRef"/>
  427.         <xsl:param name="inScript"/>
  428.         <xsl:variable name="fileRef" select="/FMPReport/File/FileReferenceCatalog/FileReference[@name=$inFileRef/@name]"/>
  429.         <xsl:choose>
  430.             <xsl:when test="$fileRef/@link">
  431.                 <xsl:call-template name="Link-WithAnchor">
  432.                     <xsl:with-param name="inAnchor" select="concat($fileRef/@link,'#', $inScript/@name, $inScript/@id,$kAnchorScript)"/>
  433.                     <xsl:with-param name="inDisplayText" select="$inScript/@name"/>
  434.                 </xsl:call-template>                
  435.             </xsl:when>
  436.             <xsl:otherwise>
  437.                 <xsl:value-of select="$inScript/@name"/>
  438.             </xsl:otherwise>
  439.         </xsl:choose>
  440.     </xsl:template>
  441.     
  442.     <xsl:template name="ScriptAnchor">
  443.         <xsl:param name="inScript"/>    
  444.         <xsl:call-template name="AnchorPoint">
  445.             <xsl:with-param name="inAnchor" select="concat($inScript/@name, $inScript/@id, $kAnchorScript)"/>
  446.             <xsl:with-param name="inDisplayText" select="$inScript/@name"/>
  447.         </xsl:call-template>                
  448.     </xsl:template>
  449.     
  450.     <!-- Account reference -->
  451.     <xsl:template name="AccountReference">
  452.         <xsl:param name="inAccount"/>
  453.         <xsl:choose>
  454.             <xsl:when test="/FMPReport/File/AccountCatalog/Account[@name = $inAccount/@name]">
  455.                 <xsl:call-template name="Link-WithAnchor">
  456.                     <xsl:with-param name="inAnchor" select="concat('#', $inAccount/@name,$kAnchorAccount)"/>
  457.                     <xsl:with-param name="inDisplayText" select="$inAccount/@name"/>
  458.                 </xsl:call-template>                
  459.             </xsl:when>
  460.             <xsl:otherwise>
  461.                 <xsl:value-of select="$inAccount/@name"/>
  462.             </xsl:otherwise>
  463.         </xsl:choose>
  464.     </xsl:template>
  465.     
  466.     <xsl:template name="AccountAnchor">
  467.         <xsl:param name="inAccount"/>
  468.             <xsl:call-template name="AnchorPoint">
  469.                 <xsl:with-param name="inAnchor" select="concat($inAccount/@name, $kAnchorAccount)"/>
  470.                 <xsl:with-param name="inDisplayText" select="$inAccount/@name"/>
  471.             </xsl:call-template>            
  472.     </xsl:template>
  473.     
  474.     <xsl:template name="PrivilegeSetAnchor">
  475.         <xsl:param name="inPrivilegeSet"/>
  476.         <xsl:call-template name="AnchorPoint">
  477.             <xsl:with-param name="inAnchor" select="concat($inPrivilegeSet/@name, $kAnchorPrivilegeSet)"/>
  478.             <xsl:with-param name="inDisplayText" select="$inPrivilegeSet/@name"/>
  479.         </xsl:call-template>        
  480.     </xsl:template>
  481.     
  482.     <xsl:template name="PrivilegeSetReference">
  483.         <xsl:param name="inPrivilegeSetName"/>
  484.         <xsl:choose>
  485.             <xsl:when test="/FMPReport/File/PrivilegesCatalog/PrivilegeSet[@name = $inPrivilegeSetName]">
  486.                 <xsl:call-template name="Link-WithAnchor">
  487.                     <xsl:with-param name="inAnchor" select="concat('#', $inPrivilegeSetName,$kAnchorPrivilegeSet)"/>
  488.                     <xsl:with-param name="inDisplayText" select="$inPrivilegeSetName"/>
  489.                 </xsl:call-template>                
  490.             </xsl:when>
  491.             <xsl:otherwise>
  492.                 <xsl:value-of select="$inPrivilegeSetName"/>
  493.             </xsl:otherwise>
  494.         </xsl:choose>
  495.     </xsl:template>
  496.     
  497.     <xsl:template name="ExtendedPrivilegeAnchor">
  498.         <xsl:param name="inExtendedPrivilege"/>
  499.         <xsl:call-template name="AnchorPoint">
  500.             <xsl:with-param name="inAnchor" select="concat($inExtendedPrivilege/@name, $kAnchorExtendedPrivilege)"/>
  501.             <xsl:with-param name="inDisplayText" select="$inExtendedPrivilege/@name"/>
  502.         </xsl:call-template>        
  503.     </xsl:template>
  504.     
  505.     <xsl:template name="ExtendedPrivilegeReference">
  506.         <xsl:param name="inExtendedPrivilege"/>
  507.         <xsl:choose>
  508.             <xsl:when test="/FMPReport/File/ExtendedPrivilegeCatalog/ExtendedPrivilege[@name = $inExtendedPrivilege/@name]">
  509.                 <xsl:call-template name="Link-WithAnchor">
  510.                     <xsl:with-param name="inAnchor" select="concat('#', $inExtendedPrivilege/@name,$kAnchorExtendedPrivilege)"/>
  511.                     <xsl:with-param name="inDisplayText" select="$inExtendedPrivilege/@name"/>
  512.                 </xsl:call-template>                
  513.             </xsl:when>
  514.             <xsl:otherwise>
  515.                 <xsl:value-of select="$inExtendedPrivilege/@name"/>
  516.             </xsl:otherwise>
  517.         </xsl:choose>
  518.     </xsl:template>
  519.     
  520.     <!-- BaseTable anchor: location to anchor to. Must be a BaseTable name! -->
  521.     <xsl:template name="BaseTableAnchor">
  522.         <xsl:param name="inBaseTable"/>
  523.         <xsl:call-template name="AnchorPoint">
  524.             <xsl:with-param name="inAnchor" select="concat($inBaseTable, $kAnchorBaseTable)"/>
  525.             <xsl:with-param name="inDisplayText" select="$inBaseTable"/>
  526.         </xsl:call-template>        
  527.     </xsl:template>        
  528.     
  529.     <!-- Field anchor: location to anchor to. Pass in a field name and base table! -->
  530.     <xsl:template name="FieldAnchor">
  531.         <xsl:param name="inField"/>
  532.         <xsl:param name="inBaseTable"/>
  533.         <xsl:call-template name="AnchorPoint">
  534.             <xsl:with-param name="inAnchor" select="concat($inBaseTable, $inField, $kAnchorField)"/>
  535.             <xsl:with-param name="inDisplayText" select="$inField"/>
  536.         </xsl:call-template>        
  537.     </xsl:template>    
  538.     
  539.     <!-- Layout anchor: location to anchor to. Pass in a Layout node! -->
  540.     <xsl:template name="LayoutAnchor">
  541.         <xsl:param name="inLayout"/>
  542.         <xsl:call-template name="AnchorPoint">
  543.             <xsl:with-param name="inAnchor" select="concat($inLayout/@name,$inLayout/@id, $kAnchorLayout)"/>
  544.             <xsl:with-param name="inDisplayText" select="$inLayout/@name"/>
  545.         </xsl:call-template>            
  546.     </xsl:template>
  547.     
  548.     <!--Table section anchor. -->
  549.     <xsl:template name="TableSectionAnchor">
  550.         <xsl:call-template name="AnchorPoint">
  551.             <xsl:with-param name="inAnchor" select="concat($valTables, $kAnchorSection)"/>
  552.             <xsl:with-param name="inDisplayText" select="$valTables"/>
  553.         </xsl:call-template>            
  554.     </xsl:template>
  555.     
  556.     <!--Field section anchor. -->
  557.     <xsl:template name="FieldSectionAnchor">
  558.         <xsl:call-template name="AnchorPoint">
  559.             <xsl:with-param name="inAnchor" select="concat($valFields, $kAnchorSection)"/>
  560.             <xsl:with-param name="inDisplayText" select="$valFields"/>
  561.         </xsl:call-template>                    
  562.     </xsl:template>
  563.     
  564.     <!-- Table occurrence/alias anchor -->
  565.     <xsl:template name="TableAliasAnchor">
  566.         <xsl:param name="inTableAlias"/>
  567.         <xsl:call-template name="TableAnchorPoint">
  568.             <xsl:with-param name="inAnchor" select="concat($inTableAlias/@name, $kAnchorTable)"/>
  569.             <xsl:with-param name="inDisplayText" select="$inTableAlias/@name"/>
  570.         </xsl:call-template>                    
  571.     </xsl:template>
  572.     
  573.     <xsl:template name="CustomFunctionReference">
  574.         <xsl:param name="inCustomFunctionName"/>
  575.         <xsl:choose>
  576.             <xsl:when test="/FMPReport/File/CustomFunctionCatalog/CustomFunction[@name = $inCustomFunctionName]">
  577.                 <xsl:call-template name="Link-WithAnchor">
  578.                     <xsl:with-param name="inAnchor" select="concat('#',$inCustomFunctionName, $kAnchorCustomFunction)"/>
  579.                     <xsl:with-param name="inDisplayText" select="$inCustomFunctionName"/>
  580.                 </xsl:call-template>                
  581.             </xsl:when>
  582.             <xsl:otherwise>
  583.                 <xsl:value-of select="$inCustomFunctionName"/>
  584.             </xsl:otherwise>
  585.         </xsl:choose>
  586.     </xsl:template>
  587.     
  588.     <xsl:template name="CustomFunctionAnchor">
  589.         <xsl:param name="inCustomFunction"/>
  590.         <xsl:call-template name="AnchorPoint">
  591.             <xsl:with-param name="inAnchor" select="concat($inCustomFunction/@name, $kAnchorCustomFunction)"/>
  592.             <xsl:with-param name="inDisplayText" select="$inCustomFunction/@name"/>
  593.         </xsl:call-template>        
  594.     </xsl:template> 
  595.         
  596.     <!-- Template for generating calculations -->
  597.     <!-- Must pass in a DisplayCalc node -->
  598.     <xsl:template name="GenerateCalc">
  599.         <xsl:param name="inDisplayCalc"/>
  600.         <!-- Process the Chunks -->
  601.         <xsl:for-each select="$inDisplayCalc/Chunk">
  602.             <xsl:choose>
  603.                 <xsl:when test="@type='CustomFunctionRef'">
  604.                     <xsl:call-template name="CustomFunctionReference">
  605.                         <xsl:with-param name="inCustomFunctionName" select="."/>
  606.                     </xsl:call-template>                                        
  607.                 </xsl:when>            
  608.                 <xsl:when test="@type='FunctionRef'">
  609.                     <strong><xsl:value-of select="."/></strong>
  610.                 </xsl:when>
  611.                 <xsl:when test="@type='NoRef'">
  612.                     <xsl:value-of select="."/>
  613.                 </xsl:when>
  614.                 <xsl:when test="@type='FieldRef'">
  615.                     <xsl:call-template name="FieldReference-ShowTableAlias">
  616.                         <xsl:with-param name="inField" select="Field"/>
  617.                     </xsl:call-template>                    
  618.                 </xsl:when>                
  619.             </xsl:choose>            
  620.         </xsl:for-each>
  621.     </xsl:template>
  622.     
  623.     <!-- Template to generate a list of table aliases of a base table -->
  624.     <xsl:template name="TableAliasList">
  625.         <xsl:param name="inBaseTable"/>
  626.             <xsl:variable name="tableAliases" select="key('TableAlias-BaseTableIndex', $inBaseTable)[not(FileReference)]"/>                    
  627.             <xsl:for-each select="$tableAliases">                
  628.                 <!-- We can do this test because table alias names are guaranteed to be unique -->
  629.                 <xsl:if test="@name!= $tableAliases[1]/@name">
  630.                     <xsl:text>, </xsl:text>
  631.                 </xsl:if>                                
  632.                 <xsl:call-template name="TableAliasReference">
  633.                     <xsl:with-param name="inTableAlias" select="."/>
  634.                 </xsl:call-template>
  635.             </xsl:for-each>            
  636.     </xsl:template>
  637.     
  638.     <!-- Template for fetching the field type information. -->
  639.     <xsl:template name="FieldType">
  640.         <xsl:param name="inFieldType"/>
  641.         <xsl:choose>
  642.             <xsl:when test="$inFieldType = 'Normal'"><xsl:value-of select="$valNormal"/></xsl:when>
  643.             <xsl:when test="$inFieldType = 'Calculated'"><xsl:value-of select="$valCalculated"/></xsl:when>
  644.             <xsl:when test="$inFieldType = 'Summary'"><xsl:value-of select="$valSummary"/></xsl:when>
  645.         </xsl:choose>    
  646.     </xsl:template>
  647.     
  648.     <!-- Template for fetching the field type information. -->
  649.     <xsl:template name="DataType">
  650.         <xsl:param name="inDataType"/>
  651.         <xsl:choose>    
  652.             <xsl:when test="$inDataType='Text'"><xsl:value-of select="$valDataTypeText"/></xsl:when>
  653.             <xsl:when test="$inDataType='Number'"><xsl:value-of select="$valDataTypeNumber"/></xsl:when>
  654.             <xsl:when test="$inDataType='Date'"><xsl:value-of select="$valDataTypeDate"/></xsl:when>
  655.             <xsl:when test="$inDataType='Time'"><xsl:value-of select="$valDataTypeTime"/></xsl:when>
  656.             <xsl:when test="$inDataType='TimeStamp'"><xsl:value-of select="$valDataTypeTimeStamp"/></xsl:when>
  657.             <xsl:when test="$inDataType='Binary'"><xsl:value-of select="$valDataTypeBinary"/></xsl:when>
  658.         </xsl:choose>    
  659.     </xsl:template>
  660.     
  661.     <!-- AutoEnter values -->
  662.     <xsl:template name="AutoEnterValue">
  663.         <xsl:param name="inAutoEnterValue"/>
  664.         <xsl:choose>
  665.             <xsl:when test="$inAutoEnterValue = 'CreationTime'"><xsl:value-of select="$valCreationTime"/></xsl:when>
  666.             <xsl:when test="$inAutoEnterValue = 'CreationDate'"><xsl:value-of select="$valCreationDate"/></xsl:when>
  667.             <xsl:when test="$inAutoEnterValue = 'CreationTimeStamp'"><xsl:value-of select="$valCreationTimeStamp"/></xsl:when>
  668.             <xsl:when test="$inAutoEnterValue = 'CreationName'"><xsl:value-of select="$valCreationName"/></xsl:when>
  669.             <xsl:when test="$inAutoEnterValue = 'CreationAccountName'"><xsl:value-of select="$valCreationAccountName"/></xsl:when>
  670.             <xsl:when test="$inAutoEnterValue = 'ModificationDate'"><xsl:value-of select="$valModificationDate"/></xsl:when>
  671.             <xsl:when test="$inAutoEnterValue = 'ModificationTime'"><xsl:value-of select="$valModificationTime"/></xsl:when>
  672.             <xsl:when test="$inAutoEnterValue = 'ModificationTimeStamp'"><xsl:value-of select="$valModificationTimeStamp"/></xsl:when>
  673.             <xsl:when test="$inAutoEnterValue = 'ModificationName'"><xsl:value-of select="$valModificationName"/></xsl:when>
  674.             <xsl:when test="$inAutoEnterValue = 'ModificationAccountName'"><xsl:value-of select="$valModificationAccountName"/></xsl:when>
  675.             <xsl:when test="$inAutoEnterValue = 'PreviousRecord'"><xsl:value-of select="$valPreviousRecord"/></xsl:when>
  676.             <xsl:when test="$inAutoEnterValue = 'ConstantData'"><xsl:value-of select="$valConstantData"/></xsl:when>
  677.         </xsl:choose>        
  678.     </xsl:template>
  679.     
  680.     <xsl:template name="LookupCopyMatchValue">
  681.         <xsl:param name="inLookupValue"/>
  682.         <xsl:choose>
  683.             <xsl:when test="$inLookupValue = 'DoNotCopy'"><xsl:value-of select="$valDoNotCopy"/></xsl:when>
  684.             <xsl:when test="$inLookupValue = 'CopyNextHigher'"><xsl:value-of select="$valCopyNextHigher"/></xsl:when>
  685.             <xsl:when test="$inLookupValue = 'CopyNextLower'"><xsl:value-of select="$valCopyNextLower"/></xsl:when>
  686.             <xsl:when test="$inLookupValue = 'CopyConstant'"><xsl:value-of select="$valCopyConstant"/></xsl:when>
  687.         </xsl:choose>        
  688.     </xsl:template>
  689.     
  690.     <!-- AutoEnter Serial value -->
  691.     <xsl:template name="AutoEnterSerialValue">
  692.         <xsl:param name="inSerialValue"/>
  693.         <xsl:choose>
  694.             <xsl:when test="$inSerialValue = 'OnCommit'"><xsl:value-of select="$valOnCommit"/></xsl:when>
  695.             <xsl:when test="$inSerialValue = 'OnCreation'"><xsl:value-of select="$valOnCreate"/></xsl:when>
  696.         </xsl:choose>
  697.     </xsl:template>
  698.     
  699.     <!-- Generate the report overview table -->
  700.     <xsl:template name="Table-Overview">
  701.         <xsl:param name="inFile"/>
  702.         <p>            
  703.             <span class="partheading">
  704.                 <xsl:call-template name="AnchorPoint">
  705.                     <xsl:with-param name="inAnchor" select="concat($valFileOptionOverview, $kAnchorSection)"/>
  706.                     <xsl:with-param name="inDisplayText" select="$inFile/@name"/>
  707.                 </xsl:call-template>                        
  708.             </span>
  709.         </p>
  710.         <table width="100%" border="1">
  711.             <tbody>
  712.                 <tr vAlign="top">
  713.                     <td class="chartsubheads" colSpan="2">
  714.                         <xsl:value-of select="$valOverview"/>
  715.                     </td>
  716.                     <td class="chartsubheads" width="1%"> </td>
  717.                     <td class="chartsubheads" colSpan="2">
  718.                         <xsl:value-of select="$valFileOptions"/>
  719.                     </td>
  720.                 </tr>            
  721.                 <tr vAlign="top">
  722.                     <td class="chartheadersnobg" width="32%">
  723.                         <xsl:value-of select="$valTables"/>
  724.                     </td>                    
  725.                     <td class="regularcharttext" width="8%">                                            
  726.                         <xsl:call-template name="SectionReference">
  727.                             <xsl:with-param name="inSection" select="$valTables"/>
  728.                             <xsl:with-param name="inCount" select="count($inFile/BaseTableCatalog/BaseTable)"/>
  729.                         </xsl:call-template>                            
  730.                     </td>
  731.                     <td class="regularcharttext"> </td>
  732.                     <td class="chartsubheads" colSpan="2">
  733.                         <xsl:value-of select="$valWhenOpeningFile"/>
  734.                     </td>                    
  735.                 </tr>
  736.                 <tr vAlign="top">
  737.                     <td class="chartheadersnobg">
  738.                         <xsl:value-of select="$valRelationships"/>
  739.                     </td>
  740.                     <td class="regularcharttext">                        
  741.                         <xsl:call-template name="SectionReference">
  742.                             <xsl:with-param name="inSection" select="$valRelationships"/>
  743.                             <xsl:with-param name="inCount" select="count($inFile/RelationshipGraph/RelationshipList/Relationship)"/>
  744.                         </xsl:call-template>                                                                            
  745.                     </td>
  746.                     <td class="regularcharttext"> </td>
  747.                     <td class="chartheadersnobg" width="%26">
  748.                         <xsl:value-of select="$valLoginUsing"/>
  749.                     </td>
  750.                     <td class="regularcharttext" width="33%">
  751.                         <xsl:choose>
  752.                             <xsl:when test="/FMPReport/File/Options/OnOpen/Account">
  753.                                 <xsl:value-of select="concat($valAccountName,'; ',$valAccount,'= ')"/>
  754.                                 <xsl:call-template name="AccountReference">
  755.                                     <xsl:with-param name="inAccount" select="/FMPReport/File/Options/OnOpen/Account"/>
  756.                                 </xsl:call-template>
  757.                             </xsl:when>
  758.                             <xsl:otherwise>
  759.                                 <xsl:value-of select="$valOff"/>
  760.                             </xsl:otherwise>
  761.                         </xsl:choose>
  762.                     </td>
  763.                 </tr>
  764.                 <tr vAlign="top">
  765.                     <td class="chartheadersnobg">
  766.                         <xsl:value-of select="$valLayouts"/>
  767.                     </td>
  768.                     <td class="regularcharttext">
  769.                         <xsl:call-template name="SectionReference">
  770.                             <xsl:with-param name="inSection" select="$valLayouts"/>
  771.                             <xsl:with-param name="inCount" select="count($inFile/LayoutCatalog/Layout)"/>
  772.                         </xsl:call-template>
  773.                     </td>
  774.                     <td class="regularcharttext"> </td>
  775.                     <td class="chartheadersnobg">
  776.                         <xsl:value-of select="$valSwitchToLayout"/>
  777.                     </td>
  778.                     <td class="regularcharttext">
  779.                         <xsl:choose>
  780.                             <xsl:when test="/FMPReport/File/Options/OnOpen/Layout">
  781.                                 <xsl:call-template name="LayoutReference">
  782.                                     <xsl:with-param name="inLayout" select="/FMPReport/File/Options/OnOpen/Layout"/>
  783.                                 </xsl:call-template>
  784.                             </xsl:when>
  785.                             <xsl:otherwise>
  786.                                 <xsl:value-of select="$valOff"/>
  787.                             </xsl:otherwise>
  788.                         </xsl:choose>
  789.                     </td>
  790.                 </tr>
  791.                 <tr vAlign="top">
  792.                     <td class="chartheadersnobg">
  793.                         <xsl:value-of select="$valScripts"/>
  794.                     </td>
  795.                     <td class="regularcharttext">                        
  796.                         <xsl:call-template name="SectionReference">
  797.                             <xsl:with-param name="inSection" select="$valScripts"/>
  798.                             <xsl:with-param name="inCount" select="count($inFile/ScriptCatalog/Script)"/>
  799.                         </xsl:call-template>
  800.                     </td>
  801.                     <td class="regularcharttext"> </td>
  802.                     <td class="chartheadersnobg">
  803.                         <xsl:value-of select="$valPerformScript"/>
  804.                     </td>    
  805.                     <td class="regularcharttext">
  806.                         <xsl:choose>
  807.                             <xsl:when test="/FMPReport/File/Options/OnOpen/Script">
  808.                                 <xsl:call-template name="ScriptReference">
  809.                                     <xsl:with-param name="inScript" select="/FMPReport/File/Options/OnOpen/Script"/>
  810.                                 </xsl:call-template>
  811.                             </xsl:when>
  812.                             <xsl:otherwise>
  813.                                 <xsl:value-of select="$valOff"/>
  814.                             </xsl:otherwise>
  815.                         </xsl:choose>
  816.                     </td>                
  817.                 </tr>    
  818.                 <tr vAlign="top">
  819.                     <td class="chartheadersnobg">
  820.                         <xsl:value-of select="$valValueLists"/>
  821.                     </td>
  822.                     <td class="regularcharttext">
  823.                         <xsl:call-template name="SectionReference">
  824.                             <xsl:with-param name="inSection" select="$valValueLists"/>
  825.                             <xsl:with-param name="inCount" select="count($inFile/ValueListCatalog/ValueList)"/>
  826.                         </xsl:call-template>                                                    
  827.                     </td>
  828.                     <td class="regularcharttext"> </td>
  829.                     <td class="chartsubheads" colSpan="2">
  830.                         <xsl:value-of select="$valWhenClosingFile"/>
  831.                     </td>
  832.                 </tr>
  833.                 <tr vAlign="top">
  834.                     <td class="chartheadersnobg">
  835.                         <xsl:value-of select="$valCustomFunctions"/>
  836.                     </td>
  837.                     <td class="regularcharttext">
  838.                         <xsl:call-template name="SectionReference">
  839.                             <xsl:with-param name="inSection" select="$valCustomFunctions"/>
  840.                             <xsl:with-param name="inCount" select="count($inFile/CustomFunctionCatalog/CustomFunction)"/>
  841.                         </xsl:call-template>                        
  842.                     </td>
  843.                     <td class="regularcharttext"> </td>
  844.                     <td class="chartheadersnobg">
  845.                         <xsl:value-of select="$valPerformScript"/>
  846.                     </td>
  847.                     <td class="regularcharttext">
  848.                         <xsl:choose>
  849.                             <xsl:when test="/FMPReport/File/Options/OnClose/Script">
  850.                                 <xsl:call-template name="ScriptReference">
  851.                                     <xsl:with-param name="inScript" select="/FMPReport/File/Options/OnClose/Script"/>
  852.                                 </xsl:call-template>
  853.                             </xsl:when>
  854.                             <xsl:otherwise>
  855.                                 <xsl:value-of select="$valOff"/>
  856.                             </xsl:otherwise>
  857.                         </xsl:choose>
  858.                     </td>
  859.                 </tr>                                
  860.                 <tr vAlign="top">
  861.                     <td class="chartheadersnobg">
  862.                         <xsl:value-of select="$valAccounts"/>
  863.                     </td>
  864.                     <td class="regularcharttext">
  865.                         <xsl:call-template name="SectionReference">
  866.                             <xsl:with-param name="inSection" select="$valAccounts"/>
  867.                             <xsl:with-param name="inCount" select="count($inFile/AccountCatalog/Account)"/>
  868.                         </xsl:call-template>                                                        
  869.                     </td>                    
  870.                 </tr>                
  871.                 <tr vAlign="top">
  872.                     <td class="chartheadersnobg">
  873.                         <xsl:value-of select="$valPrivilegeSets"/>
  874.                     </td>
  875.                     <td class="regularcharttext">                        
  876.                         <xsl:call-template name="SectionReference">
  877.                             <xsl:with-param name="inSection" select="$valPrivilegeSets"/>
  878.                             <xsl:with-param name="inCount" select="count($inFile/PrivilegesCatalog/PrivilegeSet)"/>
  879.                         </xsl:call-template>                                                        
  880.                     </td>                
  881.                 </tr>
  882.                 <tr vAlign="top">
  883.                     <td class="chartheadersnobg">
  884.                         <xsl:value-of select="$valExtendedPrivileges"/>
  885.                     </td>
  886.                     <td class="regularcharttext">                        
  887.                         <xsl:call-template name="SectionReference">
  888.                             <xsl:with-param name="inSection" select="$valExtendedPrivileges"/>
  889.                             <xsl:with-param name="inCount" select="count($inFile/ExtendedPrivilegeCatalog/ExtendedPrivilege)"/>
  890.                         </xsl:call-template>                                                        
  891.                     </td>
  892.                 </tr>
  893.                 <tr vAlign="top">
  894.                     <td class="chartheadersnobg">
  895.                         <xsl:value-of select="$valFileReferences"/>
  896.                     </td>
  897.                     <td class="regularcharttext">
  898.                         <xsl:call-template name="SectionReference">
  899.                             <xsl:with-param name="inSection" select="$valFileReferences"/>
  900.                             <xsl:with-param name="inCount" select="count($inFile/FileReferenceCatalog/FileReference)"/>
  901.                         </xsl:call-template>                                                        
  902.                     </td>                    
  903.                 </tr>                                                                                
  904.             </tbody>
  905.         </table>
  906.     </xsl:template>
  907.     
  908.     <!-- Template for generating Auto-Enter information for field -->
  909.     <!-- Must pass in an AutoEnter node -->
  910.     <xsl:template name="Table-AutoEnter">
  911.         <xsl:param name="inAutoEnter"/>
  912.         <xsl:if test="$inAutoEnter and (($inAutoEnter/ancestor::Field/@fieldType != 'Calculated') or ($inAutoEnter/@alwaysEvaluate = 'True'))">
  913.             <strong><xsl:value-of select="concat($valAutoEnter,':')"/></strong>            
  914.             <ul>
  915.                 <xsl:if test="$inAutoEnter/@value">
  916.                     <li>
  917.                         <xsl:call-template name="AutoEnterValue">
  918.                             <xsl:with-param name="inAutoEnterValue" select="$inAutoEnter/@value"/>
  919.                         </xsl:call-template>
  920.                         <xsl:if test="$inAutoEnter/ConstantData">
  921.                             <xsl:value-of select="concat(': ', $inAutoEnter/ConstantData)"/>                
  922.                         </xsl:if>
  923.                     </li>
  924.                 </xsl:if>    
  925.                 <xsl:if test="$inAutoEnter/@alwaysEvaluate = 'True'">
  926.                     <li>
  927.                         <xsl:value-of select="$valAlwaysEvaluate"/>        
  928.                     </li>
  929.                 </xsl:if>                    
  930.                 <xsl:if test="$inAutoEnter/@allowEditing = 'True'">
  931.                     <li>
  932.                         <xsl:value-of select="$valAllowEditing"/>
  933.                     </li>
  934.                 </xsl:if>    
  935.                 <xsl:if test="$inAutoEnter/@overwriteExistingValue = 'False'">
  936.                     <li>
  937.                         <xsl:value-of select="$valDoNotReplaceExisting"/>
  938.                     </li>
  939.                 </xsl:if>                                                            
  940.                 <xsl:if test="$inAutoEnter/Serial">
  941.                     <li>
  942.                         <xsl:value-of select="concat($valSerial, ': ', $valGenerate, ': ')"/>
  943.                         <xsl:call-template name="AutoEnterSerialValue">
  944.                             <xsl:with-param name="inSerialValue" select="$inAutoEnter/Serial/@generate"/>                            
  945.                         </xsl:call-template>
  946.                         <xsl:value-of select="concat(', ', $valNextValue, ': ', $inAutoEnter/Serial/@nextValue, ', ', $valIncrement, ': ', $inAutoEnter/Serial/@increment)"/>
  947.                     </li>
  948.                 </xsl:if>                
  949.                 <xsl:if test="$inAutoEnter/DisplayCalculation">
  950.                     <li>
  951.                         <xsl:value-of select="concat($valCalculation, ': ')"/>
  952.                         <xsl:call-template name="GenerateCalc">
  953.                             <xsl:with-param name="inDisplayCalc" select="$inAutoEnter/DisplayCalculation"/>
  954.                         </xsl:call-template>
  955.                     </li>
  956.                 </xsl:if>
  957.                 <xsl:if test="$inAutoEnter/Lookup">
  958.                     <li>
  959.                         <xsl:value-of select="concat($valLookup, ': ')"/>
  960.                         <xsl:if test="$inAutoEnter/Lookup/Field">
  961.                             <xsl:call-template name="FieldReference-ShowTableAlias">
  962.                                 <xsl:with-param name="inField" select="$inAutoEnter/Lookup/Field"/>
  963.                             </xsl:call-template>
  964.                         </xsl:if>
  965.                         <xsl:if test="$inAutoEnter/Lookup/NoMatchCopyOption">
  966.                             <xsl:text>, </xsl:text>
  967.                             <xsl:call-template name="LookupCopyMatchValue">
  968.                                 <xsl:with-param name="inLookupValue" select="$inAutoEnter/Lookup/NoMatchCopyOption/@value"/>
  969.                             </xsl:call-template>
  970.                             <xsl:if test="$inAutoEnter/Lookup/NoMatchCopyOption/@value = 'CopyConstant'">
  971.                                 <xsl:value-of select="concat(': ',$inAutoEnter/Lookup/CopyConstantValue)"/>
  972.                             </xsl:if>
  973.                         </xsl:if>                        
  974.                         <xsl:if test="$inAutoEnter/Lookup/CopyEmptyContent/@value = 'False'">
  975.                             <xsl:text>, </xsl:text>
  976.                             <xsl:value-of select="$valDoNotCopyContent"/>
  977.                         </xsl:if>
  978.                     </li>
  979.                 </xsl:if>                            
  980.             </ul>
  981.         </xsl:if>
  982.     </xsl:template>
  983.     
  984.     <!-- Template for generating Validation information for field -->
  985.     <!-- Must pass in an Validation node -->
  986.     <xsl:template name="Table-Validation">
  987.         <xsl:param name="inValidation"/>
  988.         <xsl:if test="$inValidation">
  989.             <strong><xsl:value-of select="concat($valValidation,':')"/></strong>            
  990.             <ul>
  991.                 <li>
  992.                     <xsl:choose>
  993.                         <xsl:when test="$inValidation/@type = 'Always'">
  994.                             <xsl:value-of select="$valAlwaysValidate"/>
  995.                         </xsl:when>
  996.                         <xsl:when test="$inValidation/@type = 'OnlyDuringDataEntry'">
  997.                             <xsl:value-of select="$valOnlyDuringDataEntry"/>
  998.                         </xsl:when>
  999.                     </xsl:choose>
  1000.                 </li>
  1001.                 <xsl:if test="$inValidation/StrictDataType">
  1002.                     <li>
  1003.                         <xsl:value-of select="concat($valStrictDataType,': ')"/>
  1004.                         <xsl:choose>
  1005.                             <xsl:when test="$inValidation/StrictDataType/@value = 'FourDigitYear'">
  1006.                                 <xsl:value-of select="$valFourDigitYear"/>
  1007.                             </xsl:when>
  1008.                             <xsl:when test="$inValidation/StrictDataType/@value = 'Numeric'">
  1009.                                 <xsl:value-of select="$valNumeric"/>
  1010.                             </xsl:when>
  1011.                             <xsl:when test="$inValidation/StrictDataType/@value = 'TimeOfDay'">
  1012.                                 <xsl:value-of select="$valTimeOfDay"/>
  1013.                             </xsl:when>
  1014.                         </xsl:choose>                        
  1015.                     </li>
  1016.                 </xsl:if>
  1017.                 <xsl:if test="$inValidation/NotEmpty/@value = 'True'">
  1018.                     <li>
  1019.                         <xsl:value-of select="$valNotEmpty"/>
  1020.                     </li>
  1021.                 </xsl:if>
  1022.                 <xsl:if test="$inValidation/Unique/@value = 'True'">
  1023.                     <li>
  1024.                         <xsl:value-of select="$valUnique"/>
  1025.                     </li>
  1026.                 </xsl:if>
  1027.                 <xsl:if test="$inValidation/Existing/@value = 'True'">
  1028.                     <li>
  1029.                         <xsl:value-of select="$valExisting"/>
  1030.                     </li>
  1031.                 </xsl:if>
  1032.                 <xsl:if test="$inValidation/StrictValidation/@value = 'True'">
  1033.                     <li>
  1034.                         <xsl:value-of select="$valStrictValidation"/>
  1035.                     </li>
  1036.                 </xsl:if>
  1037.                 <xsl:if test="$inValidation/ValueList">
  1038.                     <li>
  1039.                         <xsl:value-of select="concat($valValueList,': ')"/>
  1040.                         <xsl:call-template name="VLReference">
  1041.                             <xsl:with-param name="inVL" select="$inValidation/ValueList"/>
  1042.                         </xsl:call-template>
  1043.                     </li>
  1044.                 </xsl:if>
  1045.                 <xsl:if test="$inValidation/Range">
  1046.                     <li>
  1047.                         <xsl:value-of select="concat($valRange,': ', $inValidation/Range/@from, ' - ', $inValidation/Range/@to)"/>
  1048.                     </li>
  1049.                 </xsl:if>
  1050.                 <xsl:if test="$inValidation/MaxDataLength">
  1051.                     <li>
  1052.                         <xsl:value-of select="concat($valMaxDataLength,': ', $inValidation/MaxDataLength/@value)"/>
  1053.                     </li>
  1054.                 </xsl:if>        
  1055.                 <xsl:if test="$inValidation/ErrorMessage">
  1056.                     <li>
  1057.                         <xsl:value-of select="concat($valErrorMessage, ': ', $inValidation/ErrorMessage)"/>
  1058.                     </li>
  1059.                 </xsl:if>
  1060.                 <xsl:if test="$inValidation/DisplayCalculation">
  1061.                     <li>
  1062.                         <xsl:value-of select="concat($valCalculation, ': ')"/>
  1063.                         <xsl:call-template name="GenerateCalc">
  1064.                             <xsl:with-param name="inDisplayCalc" select="$inValidation/DisplayCalculation"/>
  1065.                         </xsl:call-template>
  1066.                     </li>
  1067.                 </xsl:if>
  1068.             </ul>
  1069.         </xsl:if>
  1070.     </xsl:template>
  1071.     
  1072.     <!-- Template for generating Storage information for field -->
  1073.     <!-- Must pass in an Storage node -->
  1074.     <xsl:template name="Table-Storage">
  1075.         <xsl:param name="inStorage"/>
  1076.         <xsl:if test="$inStorage">            
  1077.             <strong><xsl:value-of select="concat($valStorage,':')"/></strong>            
  1078.             <ul>
  1079.                 <xsl:if test="$inStorage/@global = 'True'">
  1080.                     <li>
  1081.                         <xsl:value-of select="$valGlobal"/>
  1082.                     </li>
  1083.                 </xsl:if>
  1084.                 <li>                    
  1085.                     <xsl:value-of select="concat($valRepetitions,': ', $inStorage/@maxRepetition)"/>                                            
  1086.                 </li>
  1087.                 <xsl:if test="$inStorage/@index">
  1088.                     <li>
  1089.                         <xsl:value-of select="concat($valIndexing,': ')"/>
  1090.                         <xsl:call-template name="IndexValue">
  1091.                             <xsl:with-param name="indexValue" select="$inStorage/@index"/>
  1092.                         </xsl:call-template>    
  1093.                     </li>
  1094.                 </xsl:if>
  1095.                 <xsl:if test="$inStorage/@autoIndex = 'True'">
  1096.                     <li>
  1097.                         <xsl:value-of select="$valAutoTurnIndexOn"/>
  1098.                     </li>
  1099.                 </xsl:if>        
  1100.                 <xsl:if test="$inStorage/@storeCalculationResults = 'False'">
  1101.                     <li>
  1102.                         <xsl:value-of select="$valDoNotStoreCalcResults"/>
  1103.                     </li>
  1104.                 </xsl:if>                            
  1105.                 <xsl:if test="$inStorage/@indexLanguage">
  1106.                     <li>                    
  1107.                         <xsl:value-of select="concat($valIndexLanguage,': ')"/>
  1108.                         <xsl:call-template name="Language">
  1109.                             <xsl:with-param name="inLang" select="$inStorage/@indexLanguage"/>
  1110.                         </xsl:call-template>
  1111.                     </li>
  1112.                 </xsl:if>
  1113.             </ul>
  1114.         </xsl:if>
  1115.     </xsl:template>
  1116.     
  1117.     <!-- Must pass in an Furigana node -->
  1118.     <xsl:template name="Table-Furigana">
  1119.         <xsl:param name="inFurigana"/>
  1120.         <xsl:if test="$inFurigana">            
  1121.             <strong><xsl:value-of select="concat($valFurigana,':')"/></strong>            
  1122.             <ul>
  1123.                 <xsl:if test="$inFurigana/Field">
  1124.                     <li>
  1125.                         <xsl:value-of select="concat($valUseFuriganaField,': ')"/>
  1126.                         <xsl:call-template name="FieldDefinitionReference">
  1127.                             <xsl:with-param name="inFieldDefinition" select="$inFurigana/Field"/>
  1128.                         </xsl:call-template>
  1129.                     </li>                    
  1130.                 </xsl:if>
  1131.                 <li>
  1132.                     <xsl:value-of select="concat($valTranslateInto,': ')"/>
  1133.                     <xsl:choose>
  1134.                         <xsl:when test="$inFurigana/@inputMode = 'AsEntered'">
  1135.                             <xsl:value-of select="$valAsIs"/>
  1136.                         </xsl:when>
  1137.                         <xsl:when test="$inFurigana/@inputMode = 'Hiragana'">
  1138.                             <xsl:value-of select="$valHiragana"/>
  1139.                         </xsl:when>
  1140.                         <xsl:when test="$inFurigana/@inputMode = '2ByteKatakana'">
  1141.                             <xsl:value-of select="$valFullWidthKatakana"/>
  1142.                         </xsl:when>
  1143.                         <xsl:when test="$inFurigana/@inputMode = '2ByteRoman'">
  1144.                             <xsl:value-of select="$valFullWidthRoman"/>
  1145.                         </xsl:when>
  1146.                         <xsl:when test="$inFurigana/@inputMode = '1ByteKatakana'">
  1147.                             <xsl:value-of select="$valHalfWidthKatakana"/>
  1148.                         </xsl:when>
  1149.                         <xsl:when test="$inFurigana/@inputMode = '1ByteRoman'">
  1150.                             <xsl:value-of select="$valHalfWidthRoman"/>
  1151.                         </xsl:when>                                        
  1152.                     </xsl:choose>
  1153.                 </li>
  1154.             </ul>
  1155.         </xsl:if>
  1156.     </xsl:template>
  1157.     
  1158.     <xsl:template name="IndexValue">
  1159.         <xsl:param name="indexValue"/>
  1160.         <xsl:choose>
  1161.             <xsl:when test="$indexValue = 'None'">
  1162.                 <xsl:value-of select="$valNone"/>
  1163.             </xsl:when>
  1164.             <xsl:when test="$indexValue = 'Minimal'">
  1165.                 <xsl:value-of select="$valMinimal"/>
  1166.             </xsl:when>
  1167.             <xsl:when test="$indexValue ='All'">
  1168.                 <xsl:value-of select="$valAll"/>
  1169.             </xsl:when>
  1170.         </xsl:choose>
  1171.     </xsl:template>
  1172.     
  1173.     <!-- template to generate the table headings for the Table section -->    
  1174.     <xsl:template name="TableHeadings-BaseTableCatalog">
  1175.         <tr class="chartheaders" vAlign="top">
  1176.             <td width="15%">
  1177.                 <xsl:value-of select="$valTableName"/>                
  1178.             </td>
  1179.             <td width="29%">
  1180.                 <div align="left">
  1181.                     <xsl:value-of select="$valStatistics"/>                
  1182.                 </div>
  1183.             </td>        
  1184.             <td width="29%">
  1185.                 <xsl:value-of select="$valGraphOccurrences"/>                
  1186.             </td>            
  1187.         </tr>
  1188.     </xsl:template>
  1189.     
  1190.     <!-- template to generate the table headings for the Field section -->    
  1191.     <xsl:template name="TableHeadings-FieldCatalog">
  1192.         <xsl:param name="inBaseTable"/>
  1193.         <tr class="privsetfirst" vAlign="top">
  1194.             <td colSpan="9">
  1195.                 <xsl:value-of select="concat($valTableName, ': ')"/>
  1196.                 <xsl:call-template name="BaseTableAnchor">
  1197.                     <xsl:with-param name="inBaseTable" select="$inBaseTable/@name"/>
  1198.                 </xsl:call-template>
  1199.                 <xsl:value-of select="concat(' - ',count($inBaseTable/FieldCatalog/Field), ' ', $valFields)"/>                
  1200.             </td>            
  1201.         </tr>                
  1202.         <tr class="chartheaders" vAlign="top">
  1203.             <td width="8%">                
  1204.                 <xsl:value-of select="$valFieldName"/>                
  1205.             </td>
  1206.             <td width="7%">                
  1207.                 <xsl:value-of select="$valType"/>                
  1208.             </td>
  1209.             <td width="14%">
  1210.                 <xsl:value-of select="$valOptions"/>                
  1211.             </td>
  1212.             <td width="10%">                
  1213.                 <xsl:value-of select="$valComments"/>                
  1214.             </td>
  1215.             <td width="13%">
  1216.                 <xsl:value-of select="$valOnLayouts"/>                
  1217.             </td>
  1218.             <td width="15%">
  1219.                 <xsl:value-of select="$valInRelationships"/>                
  1220.             </td>
  1221.             <td width="22%">                
  1222.                 <xsl:value-of select="$valInScripts"/>                
  1223.             </td>
  1224.             <td width="11%">                
  1225.                 <xsl:value-of select="$valInValueLists"/>                
  1226.             </td>
  1227.         </tr>
  1228.     </xsl:template>
  1229.     
  1230.     <!-- Generate table information -->
  1231.     <xsl:template name="Table-BaseTable" match="BaseTableCatalog">
  1232.     
  1233.         <p>
  1234.             <span class="partheading">
  1235.                 <xsl:call-template name="TableSectionAnchor"/>
  1236.             </span>
  1237.         </p>        
  1238.         <table width="95%" border="1">
  1239.             <tbody>
  1240.                 
  1241.                 <!-- Generate the table headings -->                
  1242.                 <xsl:call-template name="TableHeadings-BaseTableCatalog"/>
  1243.                 
  1244.                 <!-- Loop through and document all the table information -->
  1245.                 <xsl:for-each select="BaseTable">    
  1246.                     <!--SORTBYNAME removed for quicker parsing -->
  1247.                     <!--<xsl:sort select="@name"/>    -->
  1248.                     <tr class="regularcharttext" vAlign="top">                    
  1249.                         <td>                            
  1250.                             <xsl:call-template name="BaseTableReference">
  1251.                                 <xsl:with-param name="inBaseTable" select="@name"/>
  1252.                             </xsl:call-template>                            
  1253.                         </td>                        
  1254.                         <td>                            
  1255.                             <div align="left">                                                        
  1256.                                 <xsl:choose>
  1257.                                     <xsl:when test="count(FieldCatalog/Field) > 1">
  1258.                                         <xsl:call-template name="Link-WithAnchor">
  1259.                                             <xsl:with-param name="inAnchor" select="concat('#',@name, $kAnchorBaseTable)"/>
  1260.                                             <xsl:with-param name="inDisplayText" select="concat(count(FieldCatalog/Field), ' ', $valfields)"/>
  1261.                                         </xsl:call-template>                                        
  1262.                                     </xsl:when>
  1263.                                     <xsl:when test="count(FieldCatalog/Field) = 0">
  1264.                                         <xsl:value-of select="concat(count(FieldCatalog/Field), ' ', $valfields)"/>                                        
  1265.                                     </xsl:when>
  1266.                                     <xsl:otherwise>
  1267.                                         <xsl:call-template name="Link-WithAnchor">
  1268.                                             <xsl:with-param name="inAnchor" select="concat('#',@name, $kAnchorBaseTable)"/>
  1269.                                             <xsl:with-param name="inDisplayText" select="concat(count(FieldCatalog/Field), ' ', $valfield)"/>
  1270.                                         </xsl:call-template>                                        
  1271.                                     </xsl:otherwise>
  1272.                                 </xsl:choose>                    
  1273.                                 <xsl:value-of select="concat(' ', $valDefined, ', ', @records, ' ')"/>
  1274.                                 <xsl:choose>
  1275.                                     <xsl:when test="@records > 1">
  1276.                                         <xsl:value-of select="$valrecords"/>                                        
  1277.                                     </xsl:when>
  1278.                                     <xsl:otherwise>
  1279.                                         <xsl:value-of select="$valrecord"/>
  1280.                                     </xsl:otherwise>
  1281.                                 </xsl:choose>
  1282.                             </div>
  1283.                         </td>                                                                    
  1284.                         <!--Table aliases -->
  1285.                         <td>                                    
  1286.                             <xsl:call-template name="TableAliasList">
  1287.                                 <xsl:with-param name="inBaseTable" select="@name"/>
  1288.                             </xsl:call-template>                            
  1289.                         </td>                        
  1290.                     </tr>                    
  1291.                 </xsl:for-each>                
  1292.             </tbody>
  1293.         </table>        
  1294.         
  1295.         <xsl:if test="BaseTable/FieldCatalog">
  1296.             <p>
  1297.                 <span class="partheading">
  1298.                     <xsl:call-template name="FieldSectionAnchor"/>
  1299.                 </span>
  1300.             </p>
  1301.         </xsl:if>                        
  1302.         
  1303.         <!-- Loop again to generate the field information for the tables -->
  1304.         <xsl:for-each select="BaseTable">    
  1305.             <!--SORTBYNAME-->
  1306.             <!--<xsl:sort select="@name"/>-->
  1307.             <xsl:if test="generate-id(.) != generate-id(ancestor::BaseTableCatalog/BaseTable[1]) and FieldCatalog">
  1308.                 <br/>                
  1309.             </xsl:if>
  1310.             <xsl:apply-templates/>            
  1311.         </xsl:for-each>                                    
  1312.                             
  1313.     </xsl:template>
  1314.     
  1315.     <!-- Generate a table of field information stuff only right now -->
  1316.     <xsl:template name="Table-FieldCatalog" match="FieldCatalog">                
  1317.         <table width="100%" border="1">
  1318.             <tbody>
  1319.                 <!--Generate the table headings -->
  1320.                 <xsl:call-template name="TableHeadings-FieldCatalog">
  1321.                     <xsl:with-param name="inBaseTable" select="ancestor::BaseTable"/>
  1322.                 </xsl:call-template>            
  1323.                 
  1324.                 <!--Process each Field child node. -->    
  1325.                 <xsl:apply-templates/>
  1326.             </tbody>
  1327.         </table>
  1328.     </xsl:template>
  1329.  
  1330.     <xsl:template name="Table-FieldCalc">
  1331.         <xsl:param name="inFieldCalc"/>
  1332.         <xsl:if test="$inFieldCalc">
  1333.             <strong><xsl:value-of select="concat($valCalculation,':')"/></strong>
  1334.             <ul>
  1335.                 <li>
  1336.                     <xsl:call-template name="GenerateCalc">
  1337.                         <xsl:with-param name="inDisplayCalc" select="$inFieldCalc"/>
  1338.                     </xsl:call-template>
  1339.                 </li>
  1340.             </ul>
  1341.         </xsl:if>
  1342.     </xsl:template>
  1343.     
  1344.     <xsl:template name="Table-SummaryInfo">
  1345.         <xsl:param name="inSummaryInfo"/>
  1346.         <xsl:if test="$inSummaryInfo">
  1347.             <strong><xsl:value-of select="concat($valSummaryInfo,':')"/></strong>
  1348.             <ul>
  1349.                 <li>
  1350.                     <xsl:choose>
  1351.                         <xsl:when test="$inSummaryInfo/@operation = 'Total'">
  1352.                             <xsl:value-of select="$valTotal"/>
  1353.                         </xsl:when>
  1354.                         <xsl:when test="$inSummaryInfo/@operation = 'RunningTotal'">
  1355.                             <xsl:value-of select="$valRunningTotal"/>
  1356.                         </xsl:when>
  1357.                         <xsl:when test="$inSummaryInfo/@operation = 'Average'">
  1358.                             <xsl:value-of select="$valAverage"/>                        
  1359.                         </xsl:when>
  1360.                         <xsl:when test="$inSummaryInfo/@operation = 'WeightedAverage'">
  1361.                             <xsl:value-of select="$valWeightedAverage"/>
  1362.                         </xsl:when>
  1363.                         <xsl:when test="$inSummaryInfo/@operation = 'Count'">
  1364.                             <xsl:value-of select="$valCount"/>
  1365.                         </xsl:when>
  1366.                         <xsl:when test="$inSummaryInfo/@operation = 'RunningCount'">
  1367.                             <xsl:value-of select="$valRunningCount"/>
  1368.                         </xsl:when>
  1369.                         <xsl:when test="$inSummaryInfo/@operation = 'Minimum'">
  1370.                             <xsl:value-of select="$valMinimum"/>
  1371.                         </xsl:when>
  1372.                         <xsl:when test="$inSummaryInfo/@operation = 'Maximum'">
  1373.                             <xsl:value-of select="$valMaximum"/>
  1374.                         </xsl:when>
  1375.                         <xsl:when test="$inSummaryInfo/@operation = 'StdDeviation'">
  1376.                             <xsl:value-of select="$valStdDeviation"/>
  1377.                         </xsl:when>
  1378.                         <xsl:when test="$inSummaryInfo/@operation = 'StdDeviationByPopulation'">
  1379.                             <xsl:value-of select="$valStdDeviationByPopulation"/>
  1380.                         </xsl:when>
  1381.                         <xsl:when test="$inSummaryInfo/@operation = 'Fractional'">
  1382.                             <xsl:value-of select="$valFractional"/>
  1383.                         </xsl:when>
  1384.                         <xsl:when test="$inSummaryInfo/@operation = 'FractionalSubtotal'">
  1385.                             <xsl:value-of select="$valFractionalSubtotal"/>
  1386.                         </xsl:when>    
  1387.                     </xsl:choose>
  1388.                 </li>
  1389.                 <li>
  1390.                     <xsl:choose>
  1391.                         <xsl:when test="$inSummaryInfo/@summarizeRepetition = 'Together'">
  1392.                             <xsl:value-of select="$valTogether"/>
  1393.                         </xsl:when>
  1394.                         <xsl:otherwise>
  1395.                             <xsl:value-of select="$valIndividually"/>
  1396.                         </xsl:otherwise>
  1397.                     </xsl:choose>
  1398.                 </li>
  1399.                 <li>
  1400.                     <xsl:value-of select="concat($valSummaryField,': ')"/>
  1401.                     <xsl:call-template name="Link-WithAnchor">
  1402.                         <xsl:with-param name="inAnchor" select="concat('#', ancestor::BaseTable/@name, $inSummaryInfo/SummaryField/Field/@name, $kAnchorField)"/>
  1403.                         <xsl:with-param name="inDisplayText" select="$inSummaryInfo/SummaryField/Field/@name"/>
  1404.                     </xsl:call-template>
  1405.                     <xsl:if test="$inSummaryInfo/AdditionalField">
  1406.                         <xsl:value-of select="concat(', ',$valAdditionalField,': ')"/>
  1407.                         <xsl:choose>
  1408.                             <xsl:when test="$inSummaryInfo/AdditionalField/Field/@table">
  1409.                                 <xsl:call-template name="FieldReference-ShowTableAlias">
  1410.                                     <xsl:with-param name="inField" select="$inSummaryInfo/AdditionalField/Field"/>
  1411.                                 </xsl:call-template>
  1412.                             </xsl:when>
  1413.                             <xsl:otherwise>
  1414.                                 <xsl:call-template name="Link-WithAnchor">
  1415.                                     <xsl:with-param name="inAnchor" select="concat('#', ancestor::BaseTable/@name, $inSummaryInfo/AdditionalField/Field/@name, $kAnchorField)"/>
  1416.                                     <xsl:with-param name="inDisplayText" select="$inSummaryInfo/AdditionalField/Field/@name"/>
  1417.                                 </xsl:call-template>
  1418.                             </xsl:otherwise>
  1419.                         </xsl:choose>
  1420.                     </xsl:if>
  1421.                 </li>
  1422.             </ul>            
  1423.         </xsl:if>
  1424.     </xsl:template>
  1425.     
  1426.     <!-- Generate a field information -->
  1427.     <xsl:template name="Table-Field" match="FieldCatalog/Field">
  1428.         <tr class="regularcharttext" vAlign="top">
  1429.             <td>                
  1430.                 <xsl:call-template name="FieldAnchor">
  1431.                     <xsl:with-param name="inField" select="@name"/>
  1432.                     <xsl:with-param name="inBaseTable" select="ancestor::BaseTable/@name"/>
  1433.                 </xsl:call-template>                
  1434.             </td>            
  1435.             <td>                
  1436.                 <xsl:call-template name="FieldType">
  1437.                     <xsl:with-param name="inFieldType" select="@fieldType"/>
  1438.                 </xsl:call-template>    
  1439.                 <xsl:text>, </xsl:text>                
  1440.                 <xsl:call-template name="DataType">
  1441.                     <xsl:with-param name="inDataType" select="@dataType"/>
  1442.                 </xsl:call-template>    
  1443.                 <!--<xsl:if test="@alwaysEvaluate = 'True'">
  1444.                     <xsl:text>, </xsl:text>
  1445.                     <xsl:value-of select="$valAlwaysEvaluate"/>                    
  1446.                 </xsl:if>-->
  1447.             </td>    
  1448.                         
  1449.             <td>
  1450.                 <!--Field calcs -->
  1451.                 <xsl:call-template name="Table-FieldCalc">
  1452.                     <xsl:with-param name="inFieldCalc" select="DisplayCalculation"/>
  1453.                 </xsl:call-template>
  1454.                 
  1455.                 <!--Summary-->
  1456.                 <xsl:call-template name="Table-SummaryInfo">
  1457.                     <xsl:with-param name="inSummaryInfo" select="SummaryInfo"/>
  1458.                 </xsl:call-template>
  1459.                 <!-- Auto-enter information. -->
  1460.                 <xsl:call-template name="Table-AutoEnter">
  1461.                     <xsl:with-param name="inAutoEnter" select="AutoEnter"/>
  1462.                 </xsl:call-template>
  1463.                 
  1464.                 <!-- Validation informaiton -->        
  1465.                 <xsl:call-template name="Table-Validation">
  1466.                     <xsl:with-param name="inValidation" select="Validation"/>
  1467.                 </xsl:call-template>
  1468.                 
  1469.                 <!-- Storage information -->                    
  1470.                 <xsl:call-template name="Table-Storage">
  1471.                     <xsl:with-param name="inStorage" select="Storage"/>
  1472.                 </xsl:call-template>    
  1473.                 
  1474.                 <!--Furigana-->
  1475.                 <xsl:call-template name="Table-Furigana">
  1476.                     <xsl:with-param name="inFurigana" select="Furigana"/>
  1477.                 </xsl:call-template>    
  1478.             </td>    
  1479.             
  1480.             <!-- Field Comments -->    
  1481.             <td>
  1482.                 <xsl:value-of select="Comment"/>
  1483.             </td>    
  1484.             
  1485.             <!-- Generate the layout references for the fields -->    
  1486.             <xsl:variable name="varBaseTable" select="ancestor::BaseTable/@name"/>    
  1487.             <xsl:variable name="varFieldName" select="@name"/>
  1488.             <td>    
  1489.                 <ul>                            
  1490.                     <xsl:variable name="layoutList" select="/FMPReport/File/LayoutCatalog/Layout[*/*//Field[@name = $varFieldName and key('BaseTable-TableAliasIndex',@table)[@baseTable = $varBaseTable and not(FileReference)]]]"/>
  1491.                     <xsl:for-each select="$layoutList">
  1492.                         <!--SORTBYNAME-->
  1493.                         <!--<xsl:sort select="@name"/>-->
  1494.                         <li>                            
  1495.                             <xsl:call-template name="LayoutReference">
  1496.                                 <xsl:with-param name="inLayout" select="."/>
  1497.                             </xsl:call-template>                            
  1498.                         </li>
  1499.                     </xsl:for-each>                                                                    
  1500.                 </ul>                
  1501.             </td>
  1502.             <!-- Relationship References -->            
  1503.             <td>                
  1504.                 <xsl:variable name="varRelationshipList" select="/FMPReport/File/RelationshipGraph/RelationshipList/Relationship[JoinPredicateList/JoinPredicate//Field[(@name = $varFieldName) and (key('BaseTable-TableAliasIndex', @table)/@baseTable = $varBaseTable)]]"/>                    
  1505.                 <ul>
  1506.                 <xsl:for-each select="$varRelationshipList">
  1507.                     <li>
  1508.                         <xsl:call-template name="RelationshipReference">
  1509.                             <xsl:with-param name="inRelationship" select="."/>
  1510.                         </xsl:call-template>
  1511.                     </li>
  1512.                 </xsl:for-each>
  1513.                 </ul>
  1514.             </td>
  1515.                         
  1516.             <!-- Script references -->
  1517.             <td>
  1518.                 <ul>                                                            
  1519.                     <xsl:for-each select="/FMPReport/File/ScriptCatalog/Script[*/*//Field[@name = $varFieldName and key('BaseTable-TableAliasIndex',@table)[@baseTable = $varBaseTable and not(FileReference)]]]">                                                                                    
  1520.                         <!--SORTBYNAME-->
  1521.                         <!--<xsl:sort select="@name"/>-->
  1522.                         <li>                            
  1523.                             <xsl:call-template name="ScriptReference">
  1524.                                 <xsl:with-param name="inScript" select="."/>
  1525.                             </xsl:call-template>                            
  1526.                         </li>
  1527.                     </xsl:for-each>                                                                    
  1528.                 </ul>                            
  1529.             </td>
  1530.             
  1531.             <!-- Generate the value list references for fields -->
  1532.             <td>    
  1533.                 <ul>                    
  1534.                     <xsl:for-each select="/FMPReport/File/ValueListCatalog/ValueList[*/Field[@name = $varFieldName and key('BaseTable-TableAliasIndex',@table)[@baseTable = $varBaseTable and not(FileReference)]]]">                    
  1535.                         <!--SORTBYNAME-->
  1536.                         <!--<xsl:sort select="@name"/>-->
  1537.                         <li>                            
  1538.                             <xsl:call-template name="VLReference">
  1539.                                 <xsl:with-param name="inVL" select="."/>
  1540.                             </xsl:call-template>                            
  1541.                         </li>            
  1542.                     </xsl:for-each>                                
  1543.                 </ul>            
  1544.             </td>
  1545.             
  1546.         </tr>
  1547.     </xsl:template>
  1548.     
  1549.     <!-- Generate a table layout information stuff only right now -->
  1550.     
  1551.     <xsl:template name="Table-LayoutCatalog" match="LayoutCatalog">
  1552.         <p>
  1553.             <span class="partheading">
  1554.                 <xsl:call-template name="AnchorPoint">
  1555.                     <xsl:with-param name="inAnchor" select="concat($valLayouts, $kAnchorSection)"/>
  1556.                     <xsl:with-param name="inDisplayText" select="$valLayouts"/>
  1557.                 </xsl:call-template>
  1558.             </span>
  1559.         </p>
  1560.         <table width="95%" border="1">
  1561.             <tbody>
  1562.                 <tr class="chartheaders" vAlign="top">
  1563.                     <td width="12%">
  1564.                         <xsl:value-of select="$valLayoutName"/>
  1565.                     </td>
  1566.                     <td width="12%">
  1567.                         <xsl:value-of select="$valShowRecordsFrom"/>
  1568.                     </td>
  1569.                     <td width="12%">
  1570.                         <xsl:value-of select="$valSaveRecordChanges"/>
  1571.                     </td>
  1572.                     <td width="18%">
  1573.                         <xsl:value-of select="$valShowFieldFrames"/>
  1574.                     </td>
  1575.                     <td width="15%">
  1576.                         <xsl:value-of select="$valContainsFields"/>
  1577.                     </td>
  1578.                     <td width="25%">
  1579.                         <xsl:value-of select="$valContainsButtons"/>
  1580.                     </td>
  1581.                     <td width="25%">
  1582.                         <xsl:value-of select="$valUsedInScripts"/>
  1583.                     </td>
  1584.                 </tr>                
  1585.                 <xsl:apply-templates/>
  1586.             </tbody>
  1587.         </table>            
  1588.     </xsl:template>    
  1589.     
  1590.     <xsl:template name="Bit">
  1591.         <xsl:param name="inVal"/>
  1592.         <xsl:param name="inBit"/>
  1593.         <xsl:choose>
  1594.             <xsl:when test="(($inVal mod ($inBit*2)) - ($inVal mod ($inBit))) > 0">
  1595.                 <xsl:value-of select="'true'"/>
  1596.             </xsl:when>
  1597.             <xsl:otherwise>
  1598.                 <xsl:value-of select="'false'"/>
  1599.             </xsl:otherwise>
  1600.         </xsl:choose>
  1601.     </xsl:template>
  1602.     
  1603.     <xsl:template name="FieldFormatType">
  1604.         <xsl:param name="inDisplayType"/>
  1605.         <xsl:choose>
  1606.             <xsl:when test="$inDisplayType='0'">
  1607.                 <xsl:value-of select="$valEditBox"/>
  1608.             </xsl:when>
  1609.             <xsl:when test="$inDisplayType='1'">
  1610.                 <xsl:value-of select="$valPopupList"/>
  1611.             </xsl:when>
  1612.             <xsl:when test="$inDisplayType='2'">
  1613.                 <xsl:value-of select="$valPopupMenu"/>
  1614.             </xsl:when>
  1615.             <xsl:when test="$inDisplayType='3'">
  1616.                 <xsl:value-of select="$valCheckboxSet"/>
  1617.             </xsl:when>
  1618.             <xsl:when test="$inDisplayType='4'">
  1619.                 <xsl:value-of select="$valRadioButtonSet"/>
  1620.             </xsl:when>                
  1621.         </xsl:choose>
  1622.     </xsl:template>
  1623.     
  1624.     <xsl:template name="FieldFormatFlag">
  1625.         <xsl:param name="inText"/>
  1626.         <xsl:param name="inVal"/>
  1627.         <xsl:param name="inBit"/>
  1628.         <xsl:variable name="bitResult">
  1629.             <xsl:call-template name="Bit">
  1630.                 <xsl:with-param name="inVal" select="$inVal"/>
  1631.                 <xsl:with-param name="inBit" select="$inBit"/>
  1632.             </xsl:call-template>            
  1633.         </xsl:variable>
  1634.         <xsl:if test="$bitResult = 'true'">
  1635.             <xsl:value-of select="$inText"/>
  1636.         </xsl:if>
  1637.     </xsl:template>
  1638.     
  1639.     <xsl:template name="FieldFormatShowRep">
  1640.         <xsl:param name="inFieldObject"/>
  1641.         <xsl:value-of select="concat($valShowRepetition,': ')"/>
  1642.         <xsl:value-of select="concat($inFieldObject/DDRInfo/Field/@repetition,' ',$valThrough,' ')"/>
  1643.         <xsl:variable name="numOfReps">
  1644.             <xsl:choose>
  1645.                 <xsl:when test="$inFieldObject/@numOfReps < 0">
  1646.                     <xsl:value-of select="-($inFieldObject/@numOfReps)"/>
  1647.                 </xsl:when>
  1648.                 <xsl:otherwise>
  1649.                     <xsl:value-of select="$inFieldObject/@numOfReps"/>
  1650.                 </xsl:otherwise>
  1651.             </xsl:choose>
  1652.         </xsl:variable>
  1653.         <xsl:value-of select="$inFieldObject/DDRInfo/Field/@repetition + $numOfReps - 1"/>
  1654.     </xsl:template>
  1655.     
  1656.     <xsl:template name="FieldFormatOrientation">
  1657.         <xsl:param name="inFieldObject"/>
  1658.         <xsl:variable name="orientation">
  1659.             <xsl:choose>
  1660.                 <xsl:when test="$inFieldObject/@numOfReps < 0">
  1661.                     <xsl:value-of select="$valHorizontal"/>
  1662.                 </xsl:when>
  1663.                 <xsl:otherwise>
  1664.                     <xsl:value-of select="$valVertical"/>
  1665.                 </xsl:otherwise>
  1666.             </xsl:choose>        
  1667.         </xsl:variable>
  1668.         <xsl:value-of select="concat($valOrientation, ': ',$orientation)"/>
  1669.     </xsl:template>
  1670.     
  1671.     <xsl:template name="FieldFormat">
  1672.         <xsl:param name="inObject"/>
  1673.         
  1674.         <!--Bit values -->
  1675.         <xsl:variable name="bitVScrollBar" select="256"/>
  1676.         <xsl:variable name="bitIncludeOther" select="1"/>
  1677.         <xsl:variable name="bitIncludeEdit" select="8"/>
  1678.         
  1679.         <xsl:value-of select="concat($valFieldFormat,': ')"/>
  1680.         <ul>
  1681.             <li>
  1682.                 <xsl:call-template name="FieldFormatType">
  1683.                     <xsl:with-param name="inDisplayType" select="$inObject/@displayType"/>
  1684.                 </xsl:call-template>
  1685.             </li>
  1686.             <xsl:variable name="valueList" select="$inObject/DDRInfo/ValueList"/>
  1687.             <xsl:if test="$valueList">
  1688.                 <li>
  1689.                     <xsl:value-of select="concat($valDisplayValFrom, ': ')"/>
  1690.                     <xsl:call-template name="VLReference">
  1691.                         <xsl:with-param name="inVL" select="$valueList"/>
  1692.                     </xsl:call-template>
  1693.                 </li>
  1694.             </xsl:if>
  1695.             
  1696.             <!--Vertical Scroll bar. -->
  1697.             <xsl:variable name="includeVScroll">
  1698.                 <xsl:call-template name="Bit">
  1699.                     <xsl:with-param name="inVal" select="$inObject/@flags"/>
  1700.                     <xsl:with-param name="inBit" select="$bitVScrollBar"/>
  1701.                 </xsl:call-template>
  1702.             </xsl:variable>
  1703.             <xsl:if test="$includeVScroll = 'true'">
  1704.                 <li>
  1705.                     <xsl:value-of select="$valIncludeVScrollBar"/>
  1706.                 </li>
  1707.             </xsl:if>
  1708.                                     
  1709.             <!--Include Other..."-->        
  1710.             <xsl:variable name="includeOther">
  1711.                 <xsl:call-template name="Bit">
  1712.                     <xsl:with-param name="inVal" select="$inObject/@flags"/>
  1713.                     <xsl:with-param name="inBit" select="$bitIncludeOther"/>
  1714.                 </xsl:call-template>
  1715.             </xsl:variable>
  1716.             <xsl:if test="$includeOther='true'">
  1717.                 <li>
  1718.                     <xsl:value-of select="$valIncludeOther"/>
  1719.                 </li>
  1720.             </xsl:if>            
  1721.             <!--Include Edit..."-->        
  1722.             
  1723.             <xsl:variable name="includeEdit">
  1724.                 <xsl:call-template name="Bit">
  1725.                     <xsl:with-param name="inVal" select="$inObject/@flags"/>
  1726.                     <xsl:with-param name="inBit" select="$bitIncludeEdit"/>
  1727.                 </xsl:call-template>
  1728.             </xsl:variable>
  1729.             <xsl:if test="$includeEdit='true'">
  1730.                 <li>
  1731.                     <xsl:value-of select="$valIncludeEdit"/>
  1732.                 </li>
  1733.             </xsl:if>        
  1734.             
  1735.             <!--Repetition-->                                
  1736.             <xsl:if test="$inObject/DDRInfo/Field/@maxRepetition > '1'">
  1737.                 <li>
  1738.                     <xsl:call-template name="FieldFormatShowRep">
  1739.                         <xsl:with-param name="inFieldObject" select="$inObject"/>
  1740.                     </xsl:call-template>
  1741.                 </li>
  1742.                 <!--Orientation-->
  1743.                 <li>
  1744.                     <xsl:call-template name="FieldFormatOrientation">
  1745.                         <xsl:with-param name="inFieldObject" select="$inObject"/>
  1746.                     </xsl:call-template>
  1747.                 </li>
  1748.             </xsl:if>
  1749.         </ul>
  1750.     </xsl:template>
  1751.     
  1752.     <xsl:template name="FieldBehaviorInputMode">
  1753.         <xsl:param name="inVal"/>
  1754.         <xsl:choose>    
  1755.             <xsl:when test="$inVal='128'">
  1756.                 <xsl:value-of select="$valSynchFieldFont"/>
  1757.             </xsl:when>
  1758.             <xsl:when test="$inVal='129'">
  1759.                 <xsl:value-of select="$valJapActive"/>
  1760.             </xsl:when>
  1761.             <xsl:when test="$inVal='130'">
  1762.                 <xsl:value-of select="$valJapDirect"/>
  1763.             </xsl:when>
  1764.             <xsl:when test="$inVal='131'">
  1765.                 <xsl:value-of select="$valHiragana"/>
  1766.             </xsl:when>
  1767.             <xsl:when test="$inVal='132'">
  1768.                 <xsl:value-of select="$valFullWidthKatakana"/>
  1769.             </xsl:when>
  1770.             <xsl:when test="$inVal='133'">
  1771.                 <xsl:value-of select="$valFullWidthAlpha"/>
  1772.             </xsl:when>
  1773.             <xsl:when test="$inVal='134'">
  1774.                 <xsl:value-of select="$valHalfWidthKatakana"/>
  1775.             </xsl:when>
  1776.             <xsl:when test="$inVal='135'">
  1777.                 <xsl:value-of select="$valHalfWidthAlpha"/>
  1778.             </xsl:when>            
  1779.         </xsl:choose>
  1780.     </xsl:template>
  1781.     
  1782.     <xsl:template name="FieldBehavior">
  1783.         <xsl:param name="inObject"/>
  1784.         
  1785.         <xsl:variable name="bitNoFindModeEntry" select="16"/>
  1786.         <xsl:variable name="bitNoBrowseModeEntry" select="4"/>
  1787.         <xsl:variable name="bitSelectEntireContents" select="2"/>
  1788.         <xsl:variable name="bitTab" select="32"/>
  1789.         <xsl:variable name="bitReturn" select="64"/>
  1790.         <xsl:variable name="bitEnter" select="128"/>
  1791.         
  1792.         <xsl:variable name="findMode">
  1793.             <xsl:call-template name="Bit">
  1794.                 <xsl:with-param name="inVal" select="$inObject/@flags"/>
  1795.                 <xsl:with-param name="inBit" select="$bitNoFindModeEntry"/>
  1796.             </xsl:call-template>
  1797.         </xsl:variable>
  1798.         <xsl:variable name="browseMode">
  1799.             <xsl:call-template name="Bit">
  1800.                 <xsl:with-param name="inVal" select="$inObject/@flags"/>
  1801.                 <xsl:with-param name="inBit" select="$bitNoBrowseModeEntry"/>
  1802.             </xsl:call-template>
  1803.         </xsl:variable>
  1804.         <xsl:variable name="selectEntireContents">
  1805.             <xsl:call-template name="Bit">
  1806.                 <xsl:with-param name="inVal" select="$inObject/@flags"/>
  1807.                 <xsl:with-param name="inBit" select="$bitSelectEntireContents"/>
  1808.             </xsl:call-template>
  1809.         </xsl:variable>    
  1810.         <xsl:variable name="useTab">
  1811.             <xsl:call-template name="Bit">
  1812.                 <xsl:with-param name="inVal" select="$inObject/@flags"/>
  1813.                 <xsl:with-param name="inBit" select="$bitTab"/>
  1814.             </xsl:call-template>
  1815.         </xsl:variable>
  1816.         <xsl:variable name="useReturn">
  1817.             <xsl:call-template name="Bit">
  1818.                 <xsl:with-param name="inVal" select="$inObject/@flags"/>
  1819.                 <xsl:with-param name="inBit" select="$bitReturn"/>
  1820.             </xsl:call-template>
  1821.         </xsl:variable>
  1822.         <xsl:variable name="useEnter">
  1823.             <xsl:call-template name="Bit">
  1824.                 <xsl:with-param name="inVal" select="$inObject/@flags"/>
  1825.                 <xsl:with-param name="inBit" select="$bitEnter"/>
  1826.             </xsl:call-template>
  1827.         </xsl:variable>
  1828.         <xsl:if test="($findMode = 'false') or ($browseMode = 'false') or ($selectEntireContents = 'true') or ($useTab = 'true') or ($useReturn = 'true') or ($useEnter = 'true')">        
  1829.             <xsl:value-of select="concat($valFieldBehavior,':')"/>
  1830.             <ul>
  1831.                 <xsl:variable name="allowFieldEnter">                    
  1832.                     <xsl:if test="$findMode = 'false'">
  1833.                         <xsl:value-of select="$valInFindMode"/>
  1834.                     </xsl:if>                    
  1835.                     <xsl:if test="$browseMode = 'false'">
  1836.                         <xsl:choose>
  1837.                         <xsl:when test="$findMode = 'false'">
  1838.                             <xsl:value-of select="concat(', ',$valInBrowseMode)"/>
  1839.                         </xsl:when>                
  1840.                         <xsl:otherwise>
  1841.                             <xsl:value-of select="$valInBrowseMode"/>
  1842.                         </xsl:otherwise>
  1843.                         </xsl:choose>
  1844.                     </xsl:if>
  1845.                 </xsl:variable>
  1846.                 <xsl:if test="string-length($allowFieldEnter) > 0">
  1847.                     <li>
  1848.                         <xsl:value-of select="concat($valAllowFieldEnter,': ',$allowFieldEnter)"/>
  1849.                     </li>
  1850.                 </xsl:if>    
  1851.                 <!--Select entire contents-->                
  1852.                 <xsl:if test="$selectEntireContents='true'">
  1853.                     <li>
  1854.                         <xsl:value-of select="$valSelectEntireContents"/>
  1855.                     </li>
  1856.                 </xsl:if>        
  1857.                 
  1858.                 <!--Input mode-->
  1859.                 <xsl:if test="($inObject/@inputMode < '136' and $inObject/@inputMode > '127')">
  1860.                     <li>
  1861.                         <xsl:value-of select="concat($valSetInputMethod,': ')"/>
  1862.                         <xsl:call-template name="FieldBehaviorInputMode">
  1863.                             <xsl:with-param name="inVal" select="$inObject/@inputMode"/>
  1864.                         </xsl:call-template>
  1865.                     </li>
  1866.                 </xsl:if>
  1867.                 
  1868.                 <!--Go to next field-->                
  1869.                 <xsl:variable name="goToNextField">
  1870.                     <xsl:if test="$useTab='true'">
  1871.                         <xsl:value-of select="$valTabKey"/>
  1872.                     </xsl:if>
  1873.                     <xsl:if test="$useReturn ='true'">
  1874.                         <xsl:if test="$useTab='true'">
  1875.                             <xsl:value-of select="', '"/>
  1876.                         </xsl:if>
  1877.                         <xsl:value-of select="$valReturnKey"/>
  1878.                     </xsl:if>
  1879.                     <xsl:if test="$useEnter ='true'">
  1880.                         <xsl:if test="$useReturn='true' or $useTab='true'">
  1881.                             <xsl:value-of select="', '"/>
  1882.                         </xsl:if>
  1883.                         <xsl:value-of select="$valEnterKey"/>
  1884.                     </xsl:if>
  1885.                 </xsl:variable>
  1886.                 <xsl:if test="$useTab = 'true' or $useReturn = 'true' or $useEnter = 'true'">
  1887.                     <li>
  1888.                         <xsl:value-of select="concat($valGoToNextField,': ', $goToNextField)"/>
  1889.                     </li>
  1890.                 </xsl:if>
  1891.             </ul>
  1892.         </xsl:if>
  1893.     </xsl:template>
  1894.     
  1895.     <!--Generate a layout information -->
  1896.     <xsl:template name="Table-Layout" match="LayoutCatalog/Layout">
  1897.         <tr class="regularcharttext" vAlign="top">
  1898.             <td>                
  1899.                 <xsl:call-template name="LayoutAnchor">
  1900.                     <xsl:with-param name="inLayout" select="."/>
  1901.                 </xsl:call-template>                
  1902.             </td>                
  1903.             <td>
  1904.                 <xsl:call-template name="TableAliasReference">
  1905.                     <xsl:with-param name="inTableAlias" select="Table"/>
  1906.                 </xsl:call-template>
  1907.             </td>    
  1908.                         
  1909.             <td>
  1910.                 <xsl:call-template name="GetState">
  1911.                     <xsl:with-param name="inValue" select="Options/@saveRecord"/>
  1912.                 </xsl:call-template>
  1913.             </td>            
  1914.             <td>
  1915.                 <xsl:call-template name="GetState">
  1916.                     <xsl:with-param name="inValue" select="Options/@showFieldFrames"/>
  1917.                 </xsl:call-template>
  1918.             </td>
  1919.             <!-- Fields on a layout -->
  1920.             <td>
  1921.                 <ul>                    
  1922.                     <xsl:variable name="fieldList" select="*//FieldObj"/>                    
  1923.                     <xsl:for-each select="$fieldList">
  1924.                         <!--SORTBYNAME-->
  1925.                         <!--<xsl:sort select="@name"/>-->
  1926.                         <!--<xsl:variable name="currentField" select="."/>
  1927.                         <xsl:variable name="sameFieldList" select="$fieldList[(@name = $currentField/@name) and  
  1928.                                                                             (key('BaseTable-TableAliasIndex', @table)/@baseTable = key('BaseTable-TableAliasIndex', $currentField/@table)/@baseTable) and
  1929.                                                                             (string(key('BaseTable-TableAliasIndex', @table)/FileReference/@name) = string(key('BaseTable-TableAliasIndex', $currentField/@table)/FileReference/@name))]"/>                                                                                                                        
  1930.                                             
  1931.                         <xsl:if test="generate-id($currentField) = generate-id($sameFieldList[1])">
  1932.                             <li>
  1933.                                 <xsl:call-template name="FieldReference-ShowTableAlias">
  1934.                                     <xsl:with-param name="inField" select="$sameFieldList[1]"/>
  1935.                                 </xsl:call-template>                                                                
  1936.                             </li>
  1937.                         </xsl:if> -->
  1938.                         <li>
  1939.                             <xsl:call-template name="FieldReference-ShowTableAlias">
  1940.                                 <xsl:with-param name="inField" select="DDRInfo/Field"/>
  1941.                             </xsl:call-template>                        
  1942.                             <br/>
  1943.                             <xsl:call-template name="FieldFormat">
  1944.                                 <xsl:with-param name="inObject" select="."/>
  1945.                             </xsl:call-template>
  1946.                             <br/>
  1947.                             <xsl:call-template name="FieldBehavior">
  1948.                                 <xsl:with-param name="inObject" select="."/>
  1949.                             </xsl:call-template>
  1950.                                                                     
  1951.                         </li>
  1952.                         
  1953.                     </xsl:for-each>                                        
  1954.                 </ul>
  1955.             </td>                
  1956.             <!--Buttons-->
  1957.             <td>
  1958.                 <ul>
  1959.                     <xsl:variable name="buttonList" select=".//Object[@type = 'GroupButton']"/>
  1960.                     <xsl:for-each select="$buttonList">
  1961.                         <xsl:if test="GroupButtonObj/Step">
  1962.                             <li>                            
  1963.                                 <xsl:call-template name="ButtonInfo">
  1964.                                     <xsl:with-param name="inButton" select="."/>
  1965.                                 </xsl:call-template>                            
  1966.                             </li>
  1967.                         </xsl:if>
  1968.                     </xsl:for-each>
  1969.                 </ul>
  1970.             </td>
  1971.             
  1972.             <!--Script references for layout-->                        
  1973.             <td>
  1974.                 <ul>                
  1975.                     <xsl:variable name="layoutName" select="@name"/>
  1976.                     <xsl:variable name="layoutID" select="@id"/>
  1977.                     <xsl:variable name="scriptList" select="/FMPReport/File/ScriptCatalog/Script[StepList/Step/Layout[@name = $layoutName and @id = $layoutID]]"/>
  1978.                     <xsl:for-each select="$scriptList">                        
  1979.                         <li>
  1980.                             <xsl:call-template name="ScriptReference">
  1981.                                 <xsl:with-param name="inScript" select="."/>
  1982.                             </xsl:call-template>                            
  1983.                         </li>                        
  1984.                     </xsl:for-each>
  1985.                 </ul>
  1986.             </td>
  1987.         </tr>
  1988.     </xsl:template>
  1989.     
  1990.     <xsl:template name="ButtonInfo">
  1991.         <xsl:param name="inButton"/>
  1992.         <xsl:call-template name="ButtonName">
  1993.             <xsl:with-param name="inButton" select="$inButton"/>
  1994.         </xsl:call-template>
  1995.         <xsl:text>--></xsl:text>
  1996.         <xsl:value-of select="$inButton/GroupButtonObj/Step/StepText"/>
  1997.     </xsl:template>
  1998.     
  1999.     <xsl:template name="ButtonName">
  2000.         <xsl:param name="inButton"/>
  2001.         <xsl:choose>
  2002.             <xsl:when test="$inButton/GroupButtonObj/@numOfObjs > 3">
  2003.                 <xsl:value-of select="$valGroupButton"/>
  2004.             </xsl:when>
  2005.             <xsl:when test="$inButton/GroupButtonObj/@numOfObjs = 3">
  2006.                 <xsl:choose>
  2007.                     <xsl:when test="$inButton/GroupButtonObj/Object/@type = 'Text'">
  2008.                         <xsl:value-of select="$inButton/GroupButtonObj/Object/TextObj/CharacterStyleVector/Style/Data"/>
  2009.                     </xsl:when>
  2010.                     <xsl:when test="$inButton/GroupButtonObj/Object/@type = 'Field'">
  2011.                         <xsl:call-template name="FieldReference-ShowTableAlias">
  2012.                             <xsl:with-param name="inField" select="$inButton/GroupButtonObj/Object/FieldObj/DDRInfo/Field"/>
  2013.                         </xsl:call-template>
  2014.                     </xsl:when>
  2015.                     <xsl:when test="$inButton/GroupButtonObj/Object/@type = 'Rect'">
  2016.                         <xsl:value-of select="$valRect"/>
  2017.                     </xsl:when>
  2018.                     <xsl:when test="$inButton/GroupButtonObj/Object/@type = 'RRect'">
  2019.                         <xsl:value-of select="$valRRect"/>
  2020.                     </xsl:when>
  2021.                     <xsl:when test="$inButton/GroupButtonObj/Object/@type = 'Portal'">
  2022.                         <xsl:value-of select="$valPortal"/>
  2023.                     </xsl:when>                    
  2024.                     <xsl:when test="$inButton/GroupButtonObj/Object/@type = 'Line'">
  2025.                         <xsl:value-of select="$valLine"/>
  2026.                     </xsl:when>
  2027.                     <xsl:when test="$inButton/GroupButtonObj/Object/@type = 'Oval'">
  2028.                         <xsl:value-of select="$valOval"/>
  2029.                     </xsl:when>
  2030.                 </xsl:choose>
  2031.             </xsl:when>
  2032.         </xsl:choose>
  2033.     </xsl:template>
  2034.     
  2035.     <!--<xsl:template name="ButtonBoundary">
  2036.         <xsl:param name="inButton"/>
  2037.     </xsl:template>-->
  2038.     
  2039.     <!-- Generate Relaionships -->
  2040.     <xsl:template name="TableHeadings-TableOcurrences">
  2041.         <tr class="chartheaders" vAlign="top"> 
  2042.             <td width="9%"><xsl:value-of select="$valTableOccurrence"/></td>
  2043.             <td width="13%"><xsl:value-of select="$valSourceTable"/></td>
  2044.             <td width="11%"><xsl:value-of select="$valSourceFile"/></td>
  2045.             <td width="16%"><xsl:value-of select="$valInRelationships"/></td>
  2046.             <td width="12%"><xsl:value-of select="$valInScripts"/></td>
  2047.             <td width="16%"><xsl:value-of select="$valInFieldDefinitions"/></td>
  2048.             <td width="13%"><xsl:value-of select="$valInValueLists"/></td>
  2049.             <td width="10%"><xsl:value-of select="$valAssociatedLayouts"/></td>
  2050.         </tr>
  2051.     </xsl:template>
  2052.     
  2053.     <xsl:template name="Tables-Relationship" match="RelationshipGraph">
  2054.         <xsl:apply-templates/>
  2055.     </xsl:template>
  2056.     
  2057.     <!-- Get table alias. If it represents an external table, make it a reference. Otherwise, make it an anchor. -->
  2058.     <xsl:template name="GetTableAlias">
  2059.         <xsl:param name="inTableAlias"/>
  2060.         <xsl:choose>
  2061.             <!-- External table occurrence, make a reference! -->
  2062.             <xsl:when test="$inTableAlias/FileReference">
  2063.                 <xsl:call-template name="TableAliasReference">
  2064.                     <xsl:with-param name="inTableAlias" select="$inTableAlias"/>
  2065.                 </xsl:call-template>
  2066.             </xsl:when>
  2067.             <!-- Internal table occurrence, make an anchor! -->
  2068.             <xsl:otherwise>
  2069.                 <xsl:call-template name="TableAliasAnchor">
  2070.                     <xsl:with-param name="inTableAlias" select="$inTableAlias"/>
  2071.                 </xsl:call-template>
  2072.             </xsl:otherwise>
  2073.         </xsl:choose>
  2074.     </xsl:template>
  2075.     
  2076.     <xsl:template name="Table-TableOccurrences" match="TableList">
  2077.         <p>
  2078.             <span class="partheading">
  2079.                 <xsl:call-template name="AnchorPoint">
  2080.                     <xsl:with-param name="inAnchor" select="concat($valRelationships, $kAnchorSection)"/>
  2081.                     <xsl:with-param name="inDisplayText" select="concat($valRelationships,': ', $valTableOccurrences)"/>
  2082.                 </xsl:call-template>                
  2083.             </span>
  2084.         </p>
  2085.         <table width="100%" border="1">
  2086.             <xsl:call-template name="TableHeadings-TableOcurrences"/>
  2087.             
  2088.             <xsl:for-each select="Table">
  2089.                 <!--SORTBYNAME-->
  2090.                 <!--<xsl:sort select="@name"/>-->
  2091.                 <tr class="regularcharttext" vAlign="top">
  2092.                     <!--Table Occurrence-->
  2093.                     <td bgColor="{@color}">
  2094.                         
  2095.                         <xsl:call-template name="GetTableAlias">
  2096.                             <xsl:with-param name="inTableAlias" select="."/>
  2097.                         </xsl:call-template>
  2098.                     </td>
  2099.                     <!-- Source Tables -->
  2100.                     <td>
  2101.                         <xsl:call-template name="BaseTableRefGivenTableAlias">
  2102.                             <xsl:with-param name="inTableAlias" select="."/>
  2103.                         </xsl:call-template>
  2104.                     </td>
  2105.                     <!-- Source File -->
  2106.                     <td>
  2107.                         <xsl:call-template name="GetSourceFileGivenTableAlias">
  2108.                             <xsl:with-param name="inTableAlias" select ="."/>
  2109.                         </xsl:call-template>
  2110.                     </td>
  2111.                     <!--Relationship reference -->
  2112.                     <td>
  2113.                         <xsl:variable name="relationshipsWithTable" select="key('Relationship-LeftTableAliasIndex', @name) | key('Relationship-RightTableAliasIndex', @name)"/>
  2114.                         <ul>
  2115.                             <xsl:for-each select="$relationshipsWithTable">
  2116.                                 <li>
  2117.                                     <xsl:call-template name="RelationshipReference">
  2118.                                         <xsl:with-param name="inRelationship" select="."/>
  2119.                                     </xsl:call-template>
  2120.                                 </li>
  2121.                             </xsl:for-each>
  2122.                         </ul>
  2123.                     </td>
  2124.                     <!--Script reference -->
  2125.                     <xsl:variable name="varTableName" select="@name"/>
  2126.                     <td>                                                
  2127.                         <xsl:variable name="scriptRefList" select="/FMPReport/File/ScriptCatalog/Script[*/*//Field/@table = $varTableName]"/>
  2128.                         <ul>
  2129.                             <xsl:for-each select="$scriptRefList">
  2130.                                 <!--SORTBYNAME-->
  2131.                                 <!--<xsl:sort select="@name"/>-->
  2132.                                 <li>
  2133.                                     <xsl:call-template name="ScriptReference">
  2134.                                         <xsl:with-param name="inScript" select="."/>
  2135.                                     </xsl:call-template>
  2136.                                 </li>
  2137.                             </xsl:for-each>
  2138.                         </ul>
  2139.                     </td>
  2140.                     <!--Field Defintion references-->
  2141.                     <td>                        
  2142.                         <xsl:variable name="fieldRefList" select="/FMPReport/File/BaseTableCatalog/BaseTable/FieldCatalog/Field[*//Field/@table = $varTableName]"/>
  2143.                         <ul>
  2144.                             <xsl:for-each select="$fieldRefList">
  2145.                                 <!--SORTBYNAME-->
  2146.                                 <!--<xsl:sort select="@name"/>-->
  2147.                                 <li>
  2148.                                     <xsl:call-template name="FieldDefinitionReference">
  2149.                                         <xsl:with-param name="inFieldDefinition" select="."/>
  2150.                                     </xsl:call-template>
  2151.                                 </li>
  2152.                             </xsl:for-each>
  2153.                         </ul>
  2154.                     </td>
  2155.                     <!-- ValueList References -->
  2156.                     <td>                    
  2157.                         <xsl:variable name="tableName" select="@name"/>
  2158.                         <xsl:variable name="VL-List" select="/FMPReport/File/ValueListCatalog/ValueList[*/Field[@table = $tableName]]"/>
  2159.                         <ul>
  2160.                             <xsl:for-each select="$VL-List">
  2161.                                 <!--SORTBYNAME-->
  2162.                                 <!--<xsl:sort select="@name"/>-->
  2163.                                 <li>
  2164.                                     <xsl:call-template name="VLReference">
  2165.                                         <xsl:with-param name="inVL" select="."/>
  2166.                                     </xsl:call-template>
  2167.                                 </li>
  2168.                             </xsl:for-each>
  2169.                         </ul>
  2170.                     </td>
  2171.                     <!-- Layout Reference-->
  2172.                     <td>                        
  2173.                         <xsl:variable name="tableOccurrenceName" select="@name"/>
  2174.                         <xsl:variable name="layoutList" select="/FMPReport/File/LayoutCatalog/Layout[*/*//Field[@table = $tableOccurrenceName]]"/>
  2175.                         <ul>
  2176.                             <xsl:for-each select="$layoutList">
  2177.                                 <!--SORTBYNAME-->
  2178.                                 <!--<xsl:sort select="@name"/>-->
  2179.                                 <li>
  2180.                                     <xsl:call-template name="LayoutReference">
  2181.                                         <xsl:with-param name="inLayout" select="."/>
  2182.                                     </xsl:call-template>
  2183.                                 </li>
  2184.                             </xsl:for-each>
  2185.                         </ul>
  2186.                     </td>
  2187.                 </tr>
  2188.             </xsl:for-each>
  2189.         </table>
  2190.     </xsl:template>
  2191.  
  2192.     <xsl:template name="Table-RelationshipDetails" match="RelationshipList">
  2193.         <p>
  2194.             <span class="partheading">
  2195.                 <xsl:call-template name="AnchorPoint">
  2196.                     <xsl:with-param name="inAnchor" select="concat($valDetails, $kAnchorSection)"/>
  2197.                     <xsl:with-param name="inDisplayText" select="concat($valRelationships,': ', $valDetails)"/>
  2198.                 </xsl:call-template>                
  2199.             </span>
  2200.         </p>
  2201.         <xsl:for-each select="Relationship">
  2202.             <p>
  2203.                 <span class="partheading">
  2204.                     <xsl:value-of select="concat($valRelationship,': ')"/>
  2205.                     <xsl:call-template name="RelationshipAnchor">
  2206.                         <xsl:with-param name="inRelationship" select="."/>
  2207.                     </xsl:call-template>
  2208.                 </span>
  2209.             </p>
  2210.             <xsl:variable name="leftTableName" select="LeftTable/@name"/>
  2211.             <xsl:variable name="rightTableName" select="RightTable/@name"/>
  2212.             <table width="100%" border="1">
  2213.                 <tbody>
  2214.                     <tr vAlign="top">
  2215.                         <td class="chartheadersnobg" width="18%"><xsl:value-of select="$valTableOccurrence"/></td>
  2216.                         <td class="regularcharttext" bgColor="{key('BaseTable-TableAliasIndex',$leftTableName)/@color}">
  2217.                             <xsl:call-template name="TableAliasReferenceGivenName">
  2218.                                 <xsl:with-param name="inTableAliasName" select="$leftTableName"/>
  2219.                             </xsl:call-template>
  2220.                         </td>
  2221.                         <td class="regularcharttext"></td>
  2222.                         <td class="regularcharttext" bgColor="{key('BaseTable-TableAliasIndex',$rightTableName)/@color}">
  2223.                             <xsl:call-template name="TableAliasReferenceGivenName">
  2224.                                 <xsl:with-param name="inTableAliasName" select="$rightTableName"/>
  2225.                             </xsl:call-template>
  2226.                         </td>
  2227.                     </tr>
  2228.                     <!--Now report the join predicates of the relationship!-->
  2229.                     <xsl:for-each select="JoinPredicateList/JoinPredicate">
  2230.                         <tr vAlign="top">
  2231.                             <xsl:choose>
  2232.                                 <xsl:when    test="generate-id(.) = generate-id(ancestor::JoinPredicateList/JoinPredicate[1])">
  2233.                                     <td class="chartheadersnobg">
  2234.                                         <xsl:value-of select="$valField"/>
  2235.                                     </td>
  2236.                                 </xsl:when>
  2237.                                 <xsl:otherwise>
  2238.                                     <td class="chartheadersnobg" align="right">
  2239.                                         <xsl:value-of select="$valAnd"/>
  2240.                                     </td>
  2241.                                 </xsl:otherwise>
  2242.                             </xsl:choose>
  2243.                             <td class="regularcharttext">
  2244.                                 <xsl:call-template name="FieldReference-ShowFieldNameOnly">
  2245.                                     <xsl:with-param name="inField" select="LeftField/Field"/>
  2246.                                 </xsl:call-template>
  2247.                             </td>
  2248.                             <td class="regularcharttext"  align="middle">
  2249.                                 <xsl:call-template name="JoinPredicateType">
  2250.                                     <xsl:with-param name="inJoinPredicate" select="."/>
  2251.                                 </xsl:call-template>
  2252.                             </td>
  2253.                             <td class="regularcharttext">
  2254.                                 <xsl:call-template name="FieldReference-ShowFieldNameOnly">
  2255.                                     <xsl:with-param name="inField" select="RightField/Field"/>
  2256.                                 </xsl:call-template>
  2257.                             </td>
  2258.                         </tr>
  2259.                     </xsl:for-each>
  2260.                     
  2261.                     <!--Source Table -->
  2262.                     <xsl:variable name="leftTableAlias" select="/FMPReport/File/RelationshipGraph/TableList/Table[@name = $leftTableName]"/>
  2263.                     <xsl:variable name="rightTableAlias" select="/FMPReport/File/RelationshipGraph/TableList/Table[@name = $rightTableName]"/>
  2264.                     
  2265.                     <tr vAlign="top">
  2266.                         <td class="chartheadersnobg">
  2267.                             <xsl:value-of select="$valSourceTable"/>
  2268.                         </td>
  2269.                         <td class="regularcharttext">
  2270.                             <xsl:call-template name="BaseTableRefGivenTableAlias">
  2271.                                 <xsl:with-param name="inTableAlias" select="$leftTableAlias"/>
  2272.                             </xsl:call-template>
  2273.                         </td>
  2274.                         <td class="regularcharttext">
  2275.                         </td>
  2276.                         <td class="regularcharttext">
  2277.                             <xsl:call-template name="BaseTableRefGivenTableAlias">
  2278.                                 <xsl:with-param name="inTableAlias" select="$rightTableAlias"/>
  2279.                             </xsl:call-template>
  2280.                         </td>
  2281.                     </tr>
  2282.                     <!--Source File -->
  2283.                     <tr vAlign="top">
  2284.                         <td class="chartheadersnobg">
  2285.                             <xsl:value-of select="$valSourceFile"/>
  2286.                         </td>
  2287.                         <td class="regularcharttext">
  2288.                             <xsl:call-template name="GetSourceFileGivenTableAlias">
  2289.                                 <xsl:with-param name="inTableAlias" select="$leftTableAlias"/>
  2290.                             </xsl:call-template>
  2291.                         </td>
  2292.                         <td class="regularcharttext">
  2293.                         </td>
  2294.                         <td class="regularcharttext">
  2295.                             <xsl:call-template name="GetSourceFileGivenTableAlias">
  2296.                                 <xsl:with-param name="inTableAlias" select="$rightTableAlias"/>
  2297.                             </xsl:call-template>
  2298.                         </td>
  2299.                     </tr>
  2300.                     <!--Cascade create-->
  2301.                     <tr vAlign="top">
  2302.                         <td class="chartheadersnobg">
  2303.                             <xsl:value-of select="$valAllowCreationRelatedRecords"/>
  2304.                         </td>
  2305.                         <td class="regularcharttext">
  2306.                             <xsl:call-template name="GetState">
  2307.                                 <xsl:with-param name="inValue" select="LeftTable/@cascadeCreate"/>
  2308.                             </xsl:call-template>
  2309.                         </td>
  2310.                         <td class="regularcharttext">
  2311.                         </td>
  2312.                         <td class="regularcharttext">
  2313.                             <xsl:call-template name="GetState">
  2314.                                 <xsl:with-param name="inValue" select="RightTable/@cascadeCreate"/>
  2315.                             </xsl:call-template>
  2316.                         </td>
  2317.                     </tr>
  2318.                     <!--Cascade Delete-->
  2319.                     <tr vAlign="top">
  2320.                         <td class="chartheadersnobg">
  2321.                             <xsl:value-of select="$valAllowDeleteRelatedRecords"/>
  2322.                         </td>
  2323.                         <td class="regularcharttext">
  2324.                             <xsl:call-template name="GetState">
  2325.                                 <xsl:with-param name="inValue" select="LeftTable/@cascadeDelete"/>
  2326.                             </xsl:call-template>
  2327.                         </td>
  2328.                         <td class="regularcharttext">
  2329.                         </td>
  2330.                         <td class="regularcharttext">
  2331.                             <xsl:call-template name="GetState">
  2332.                                 <xsl:with-param name="inValue" select="RightTable/@cascadeDelete"/>
  2333.                             </xsl:call-template>
  2334.                         </td>
  2335.                     </tr>                    
  2336.                     <tr vAlign="top">
  2337.                         <td class="chartheadersnobg">
  2338.                             <xsl:value-of select="$valSortRecords"/>
  2339.                         </td>
  2340.                         <td class="regularcharttext">
  2341.                             <xsl:choose>
  2342.                                 <xsl:when test="LeftTable/SortList">
  2343.                                     <p><xsl:value-of select="$valOn"/></p>
  2344.                                     <xsl:for-each select="LeftTable/SortList/Sort">
  2345.                                         <xsl:call-template name="Sort">
  2346.                                             <xsl:with-param name="inSort" select="."/>
  2347.                                         </xsl:call-template>
  2348.                                     </xsl:for-each>                                    
  2349.                                 </xsl:when>
  2350.                                 <xsl:otherwise>
  2351.                                     <p><xsl:value-of select="$valOff"/></p>
  2352.                                 </xsl:otherwise>
  2353.                             </xsl:choose>
  2354.                         </td>
  2355.                         <td class="regularcharttext">
  2356.                         </td>
  2357.                             <td class="regularcharttext">
  2358.                             <xsl:choose>
  2359.                                 <xsl:when test="RightTable/SortList">
  2360.                                     <xsl:value-of select="$valOn"/>
  2361.                                     <xsl:for-each select="RightTable/SortList/Sort">
  2362.                                         <xsl:call-template name="Sort">
  2363.                                             <xsl:with-param name="inSort" select="."/>
  2364.                                         </xsl:call-template>
  2365.                                     </xsl:for-each>    
  2366.                                 </xsl:when>
  2367.                                 <xsl:otherwise>
  2368.                                     <xsl:value-of select="$valOff"/>
  2369.                                 </xsl:otherwise>
  2370.                             </xsl:choose>
  2371.                         </td>
  2372.                     </tr>
  2373.                 </tbody>
  2374.             </table>
  2375.         </xsl:for-each>
  2376.     </xsl:template>
  2377.     
  2378.     <xsl:template name="Sort">
  2379.         <xsl:param name="inSort"/>
  2380.         <xsl:if test="$inSort/PrimaryField">
  2381.             <p>
  2382.                 
  2383.                 <xsl:value-of select="concat($valField,': ')"/>
  2384.                 <xsl:call-template name="FieldReference-ShowFieldNameOnly">
  2385.                     <xsl:with-param name="inField" select="$inSort/PrimaryField/Field"/>
  2386.                 </xsl:call-template>
  2387.             </p>
  2388.             <ul>
  2389.                 <li>
  2390.                     <xsl:call-template name="SortType">
  2391.                         <xsl:with-param name="inSort" select="$inSort"/>
  2392.                     </xsl:call-template>
  2393.                     <xsl:if test="$inSort/@type = 'Custom'">
  2394.                         <xsl:text>: </xsl:text>
  2395.                         <xsl:call-template name="VLReference">
  2396.                             <xsl:with-param name="inVL" select="$inSort/ValueList"/>
  2397.                         </xsl:call-template>
  2398.                     </xsl:if>
  2399.                 </li>                
  2400.                 <li>
  2401.                     <xsl:value-of select="concat($valReoderSummaryField,': ')"/>
  2402.                     <xsl:choose>
  2403.                         <xsl:when test="$inSort/SummaryField">
  2404.                             <xsl:call-template name="FieldReference-ShowFieldNameOnly">
  2405.                                 <xsl:with-param name="inField" select="$inSort/SummaryField/Field"/>
  2406.                             </xsl:call-template>
  2407.                         </xsl:when>
  2408.                         <xsl:otherwise>
  2409.                             <xsl:value-of select="$valOff"/>
  2410.                         </xsl:otherwise>
  2411.                     </xsl:choose>
  2412.                 </li>                
  2413.                 <li>
  2414.                     <xsl:choose>
  2415.                         <xsl:when test="$inSort/OverrideLanguage">
  2416.                             <xsl:value-of select="concat($valOverrideFieldLang,': ',$inSort/OverrideLanguage/@language)"/>
  2417.                         </xsl:when>
  2418.                         <xsl:otherwise>
  2419.                             <xsl:value-of select="concat($valOverrideFieldLang,': ',$valOff)"/>
  2420.                         </xsl:otherwise>    
  2421.                     </xsl:choose>                                        
  2422.                 </li>                
  2423.             </ul>
  2424.         </xsl:if>
  2425.     </xsl:template>
  2426.     
  2427.     <xsl:template name="SortType">
  2428.         <xsl:param name="inSort"/>
  2429.         <xsl:choose>
  2430.             <xsl:when test="$inSort/@type = 'Ascending'">
  2431.                 <xsl:value-of select="$valAscending"/>
  2432.             </xsl:when>
  2433.             <xsl:when test="$inSort/@type = 'Descending'">
  2434.                 <xsl:value-of select="$valDescending"/>
  2435.             </xsl:when>
  2436.             <xsl:when test="$inSort/@type = 'Custom'">
  2437.                 <xsl:value-of select="$valCustomValueList"/>
  2438.             </xsl:when>
  2439.         </xsl:choose>
  2440.     </xsl:template>
  2441.     <!--Get TableAlias Reference given the name -->
  2442.     <xsl:template name="TableAliasReferenceGivenName">
  2443.         <xsl:param name="inTableAliasName"/>
  2444.         <xsl:variable name="tableAlias" select="/FMPReport/File/RelationshipGraph/TableList/Table[@name = $inTableAliasName]"/>
  2445.         <xsl:choose>
  2446.             <xsl:when test="$tableAlias">
  2447.                 <xsl:call-template name="TableAliasReference">
  2448.                     <xsl:with-param name="inTableAlias" select="$tableAlias"/>
  2449.                 </xsl:call-template>
  2450.             </xsl:when>
  2451.             <xsl:otherwise>
  2452.                 <em><xsl:value-of select="$inTableAliasName"/></em>
  2453.             </xsl:otherwise>
  2454.         </xsl:choose>
  2455.     </xsl:template>
  2456.     
  2457.     <!-- Get the relationship reference -->
  2458.     <xsl:template name="RelationshipReference">
  2459.         <xsl:param name="inRelationship"/>
  2460.         <xsl:variable name="relationshipName">
  2461.             <xsl:call-template name="GetRelationshipName">
  2462.                 <xsl:with-param name="inRelationship" select="$inRelationship"/>
  2463.             </xsl:call-template>
  2464.         </xsl:variable>
  2465.         <xsl:call-template name="ItalicLink-WithAnchor">
  2466.             <xsl:with-param name="inAnchor" select="concat('#',$relationshipName, $kAnchorRelationship)"/>
  2467.             <xsl:with-param name="inDisplayText" select="$relationshipName"/>
  2468.         </xsl:call-template>        
  2469.     </xsl:template>
  2470.     
  2471.     <!--Relationship anchor -->
  2472.     <xsl:template name="RelationshipAnchor">
  2473.         <xsl:param name="inRelationship"/>
  2474.         <xsl:variable name="relationshipName">
  2475.             <xsl:call-template name="GetRelationshipName">
  2476.                 <xsl:with-param name="inRelationship" select="$inRelationship"/>
  2477.             </xsl:call-template>
  2478.         </xsl:variable>
  2479.         <xsl:call-template name="ItalicAnchorPoint">
  2480.             <xsl:with-param name="inAnchor" select="concat($relationshipName, $kAnchorRelationship)"/>
  2481.             <xsl:with-param name="inDisplayText" select="$relationshipName"/>
  2482.         </xsl:call-template>        
  2483.     </xsl:template>
  2484.     
  2485.     
  2486.     <xsl:template name="GetRelationshipName">
  2487.         <xsl:param name="inRelationship"/>
  2488.         <xsl:variable name="relationshipType">
  2489.             <xsl:call-template name="GetRelationshipType">
  2490.                 <xsl:with-param name="inRelationship" select="$inRelationship"/>
  2491.             </xsl:call-template>
  2492.         </xsl:variable>
  2493.         <xsl:value-of select="concat($inRelationship/LeftTable/@name, $relationshipType, $inRelationship/RightTable/@name)"/>
  2494.     </xsl:template>
  2495.     
  2496.     <xsl:template name="GetRelationshipType">
  2497.         <xsl:param name="inRelationship"/>
  2498.         <xsl:choose>
  2499.             <xsl:when test="count($inRelationship/JoinPredicateList/JoinPredicate) > 1">
  2500.                 <xsl:value-of select="$valInfinite"/>
  2501.             </xsl:when>
  2502.             <xsl:otherwise>
  2503.                 <xsl:call-template name="JoinPredicateType">
  2504.                     <xsl:with-param name="inJoinPredicate" select="$inRelationship/JoinPredicateList/JoinPredicate[1]"/>
  2505.                 </xsl:call-template>
  2506.             </xsl:otherwise>
  2507.         </xsl:choose>
  2508.     </xsl:template>
  2509.  
  2510.     <xsl:template name="JoinPredicateType">
  2511.         <xsl:param name="inJoinPredicate"/>
  2512.         <xsl:choose>
  2513.             <xsl:when test="$inJoinPredicate/@type = 'Equal'">
  2514.                 <xsl:value-of select="$valEqual"/>
  2515.             </xsl:when>
  2516.             <xsl:when test="$inJoinPredicate/@type = 'NotEqual'">
  2517.                 <xsl:value-of select="$valNotEqual"/>
  2518.             </xsl:when>
  2519.             <xsl:when test="$inJoinPredicate/@type = 'LessThan'">
  2520.                 <xsl:value-of select="$valLessThan"/>
  2521.             </xsl:when>
  2522.             <xsl:when test="$inJoinPredicate/@type = 'LessThanOrEqualTo'">
  2523.                 <xsl:value-of select="$valLessThanOrEqualTo"/>
  2524.             </xsl:when>
  2525.             <xsl:when test="$inJoinPredicate/@type = 'GreaterThan'">
  2526.                 <xsl:value-of select="$valGreaterThan"/>
  2527.             </xsl:when>
  2528.             <xsl:when test="$inJoinPredicate/@type = 'GreaterThanOrEqualTo'">
  2529.                 <xsl:value-of select="$valGreaterThanOrEqualTo"/>
  2530.             </xsl:when>
  2531.             <xsl:when test="$inJoinPredicate/@type = 'CartesianProduct'">
  2532.                 <xsl:value-of select="$valCartesianProduct"/>
  2533.             </xsl:when>
  2534.         </xsl:choose>
  2535.     </xsl:template>
  2536.     
  2537.     <xsl:template name="GetSourceFileGivenTableAlias">
  2538.         <xsl:param name="inTableAlias"/>
  2539.         <xsl:choose>
  2540.             <xsl:when test="$inTableAlias/FileReference">
  2541.                 <xsl:value-of select="concat($valFileReference,': ')"/>
  2542.                 <xsl:call-template name="FileRefReference">
  2543.                     <xsl:with-param name="inFileReference" select="$inTableAlias/FileReference"/>
  2544.                 </xsl:call-template>
  2545.             </xsl:when>
  2546.             <xsl:otherwise>
  2547.                 <xsl:value-of select="/FMPReport/File/@name"/>
  2548.             </xsl:otherwise>
  2549.         </xsl:choose>
  2550.     </xsl:template>
  2551.             
  2552.     <xsl:template name="GetState">
  2553.         <xsl:param name="inValue"/>
  2554.         <xsl:choose>
  2555.             <xsl:when test="$inValue = 'True'">
  2556.                 <xsl:value-of select="$valOn"/>
  2557.             </xsl:when>
  2558.             <xsl:otherwise>
  2559.                 <xsl:value-of select="$valOff"/>
  2560.             </xsl:otherwise>
  2561.         </xsl:choose>
  2562.     </xsl:template>        
  2563.         
  2564.     
  2565.     <!--Generate privilege information-->
  2566.     <xsl:template name="Table-PrivilegeCatalog" match="PrivilegesCatalog">
  2567.         <p>
  2568.             <span class="partheading">
  2569.                 <xsl:call-template name="AnchorPoint">
  2570.                     <xsl:with-param name="inAnchor" select="concat($valPrivilegeSets, $kAnchorSection)"/>
  2571.                     <xsl:with-param name="inDisplayText" select="$valPrivilegeSets"/>
  2572.                 </xsl:call-template>                
  2573.             </span>
  2574.         </p>
  2575.         <xsl:for-each select="PrivilegeSet">
  2576.             <table width="95%" border="1">
  2577.                 <tbody>
  2578.                     <tr class="privsetfirst" vAlign="top">
  2579.                         <td colSpan="2">
  2580.                             <xsl:value-of select="concat($valPrivilegeSet, ': ')"/>
  2581.                             <xsl:call-template name="PrivilegeSetAnchor">
  2582.                                 <xsl:with-param name="inPrivilegeSet" select="."/>
  2583.                             </xsl:call-template>
  2584.                         </td>
  2585.                     </tr>
  2586.                     <tr vAlign="top">
  2587.                         <td class="chartheadersnobg" width="11%">
  2588.                             <xsl:value-of select="$valDescription"/>
  2589.                         </td>
  2590.                         <td class="regularcharttext" width="89%">
  2591.                             <xsl:value-of select="@comment"/>
  2592.                         </td>
  2593.                     </tr>
  2594.                     <tr vAlign="top">
  2595.                         <td class="chartheadersnobg">
  2596.                             <xsl:value-of select="$valUsedBy"/>
  2597.                         </td>
  2598.                         <td class="regularcharttext">
  2599.                             <xsl:variable name="currentPrivilegeSet" select="."/>
  2600.                             <xsl:variable name="accountList" select="/FMPReport/File/AccountCatalog/Account[@privilegeSet = $currentPrivilegeSet/@name]"/>
  2601.                             <xsl:for-each select="$accountList">
  2602.                                 <!--SORTBYNAME-->
  2603.                                 <!--<xsl:sort select="@name"/>-->
  2604.                                 <xsl:if test="generate-id(.) != generate-id($accountList[1])">
  2605.                                     <xsl:value-of select="', '"/>
  2606.                                 </xsl:if>
  2607.                                 <xsl:call-template name="AccountReference">
  2608.                                     <xsl:with-param name="inAccount" select="."/>
  2609.                                 </xsl:call-template>
  2610.                             </xsl:for-each>
  2611.                         </td>
  2612.                     </tr>
  2613.                 </tbody>
  2614.             </table>
  2615.             <!--Data Access and Design -->
  2616.             <table width="95%" border="1">
  2617.                 <tbody>
  2618.                     <tr vAlign="top">
  2619.                         <td class="chartsubheads" colSpan="5">
  2620.                             <xsl:value-of select="$valDataAccessAndDesign"/>
  2621.                         </td>
  2622.                     </tr>
  2623.                     <!--Record privileges-->
  2624.                     <tr vAlign="top">
  2625.                         <td class="chartheadersnobg" width="11%">
  2626.                             <xsl:value-of select="$valRecords"/>
  2627.                         </td>
  2628.                         <td class="regularcharttext" width="19%">
  2629.                             <xsl:call-template name="GetAccessType">
  2630.                                 <xsl:with-param name="inAccessType" select="Records/@value"/>
  2631.                             </xsl:call-template>
  2632.                         </td>
  2633.                         <xsl:choose>
  2634.                             <xsl:when test="Records/@value != 'Custom'">
  2635.                                 <td class="regularcharttext" width="70%">
  2636.                                 </td>
  2637.                             </xsl:when>
  2638.                             <xsl:otherwise>
  2639.                                 <td width="69%" colSpan="2">
  2640.                                     <xsl:call-template name="TablePrivileges">
  2641.                                         <xsl:with-param name="inTableList" select="Records/TableList"/>
  2642.                                     </xsl:call-template>
  2643.                                 </td>
  2644.                             </xsl:otherwise>
  2645.                         </xsl:choose>
  2646.                     </tr>
  2647.                     
  2648.                     <!--Layout privileges-->
  2649.                     <tr vAlign="top">
  2650.                         <td class="chartheadersnobg" width="11%">
  2651.                             <xsl:value-of select="$valLayouts"/>
  2652.                         </td>
  2653.                         <td class="regularcharttext" width="19%">
  2654.                             <xsl:call-template name="GetAccessType">
  2655.                                 <xsl:with-param name="inAccessType" select="Layouts/@value"/>
  2656.                             </xsl:call-template>
  2657.                         </td>
  2658.                         <xsl:choose>
  2659.                             <xsl:when test="Layouts/@value != 'Custom'">
  2660.                                 <td class="regularcharttext" width="70%">
  2661.                                 </td>
  2662.                             </xsl:when>
  2663.                             <xsl:otherwise>
  2664.                                 <td width="69%" colSpan="2">
  2665.                                     <span class="regularcharttext">
  2666.                                         <xsl:value-of select="concat($valAllowCreationLayouts, ': ')"/>
  2667.                                         <xsl:call-template name="GetState">
  2668.                                             <xsl:with-param name="inValue" select="Layouts/@allowCreation"/>
  2669.                                         </xsl:call-template>
  2670.                                     </span>
  2671.                                     <xsl:call-template name="LayoutPrivileges">
  2672.                                         <xsl:with-param name="inLayoutList" select="Layouts/LayoutList"/>
  2673.                                     </xsl:call-template>
  2674.                                 </td>
  2675.                             </xsl:otherwise>
  2676.                         </xsl:choose>
  2677.                     </tr>
  2678.                     
  2679.                     <!-- Value list privileges-->
  2680.                     <tr vAlign="top">
  2681.                         <td class="chartheadersnobg" width="11%">
  2682.                             <xsl:value-of select="$valValueLists"/>
  2683.                         </td>
  2684.                         <td class="regularcharttext" width="19%">
  2685.                             <xsl:call-template name="GetAccessType">
  2686.                                 <xsl:with-param name="inAccessType" select="ValueLists/@value"/>
  2687.                             </xsl:call-template>
  2688.                         </td>
  2689.                         <xsl:choose>
  2690.                             <xsl:when test="ValueLists/@value != 'Custom'">
  2691.                                 <td class="regularcharttext" width="70%">
  2692.                                 </td>
  2693.                             </xsl:when>
  2694.                             <xsl:otherwise>
  2695.                                 <td width="69%" colSpan="2">
  2696.                                     <span class="regularcharttext">
  2697.                                         <xsl:value-of select="concat($valAllowCreationValueLists, ': ')"/>
  2698.                                         <xsl:call-template name="GetState">
  2699.                                             <xsl:with-param name="inValue" select="ValueLists/@allowCreation"/>
  2700.                                         </xsl:call-template>
  2701.                                     </span>
  2702.                                     <xsl:call-template name="ValueListPrivileges">
  2703.                                         <xsl:with-param name="inValueListList" select="ValueLists/ValueListList"/>
  2704.                                     </xsl:call-template>
  2705.                                 </td>
  2706.                             </xsl:otherwise>
  2707.                         </xsl:choose>
  2708.                     </tr>
  2709.                     
  2710.                     <!--Script Privileges-->
  2711.                     <tr vAlign="top">
  2712.                         <td class="chartheadersnobg" width="11%">
  2713.                             <xsl:value-of select="$valScripts"/>
  2714.                         </td>
  2715.                         <td class="regularcharttext" width="19%">
  2716.                             <xsl:call-template name="GetAccessType">
  2717.                                 <xsl:with-param name="inAccessType" select="Scripts/@value"/>
  2718.                             </xsl:call-template>
  2719.                         </td>
  2720.                         <xsl:choose>
  2721.                             <xsl:when test="Scripts/@value != 'Custom'">
  2722.                                 <td class="regularcharttext" width="70%">
  2723.                                 </td>
  2724.                             </xsl:when>
  2725.                             <xsl:otherwise>
  2726.                                 <td width="69%" colSpan="2">
  2727.                                     <span class="regularcharttext">
  2728.                                         <xsl:value-of select="concat($valAllowCreationScripts, ': ')"/>
  2729.                                         <xsl:call-template name="GetState">
  2730.                                             <xsl:with-param name="inValue" select="Scripts/@allowCreation"/>
  2731.                                         </xsl:call-template>
  2732.                                     </span>
  2733.                                     <xsl:call-template name="ScriptPrivileges">
  2734.                                         <xsl:with-param name="inScriptList" select="Scripts/ScriptList"/>
  2735.                                     </xsl:call-template>
  2736.                                 </td>
  2737.                             </xsl:otherwise>
  2738.                         </xsl:choose>
  2739.                     </tr>
  2740.                 </tbody>
  2741.             </table>
  2742.             
  2743.             <!--Other privileges -->
  2744.             <xsl:call-template name="OtherPrivileges">
  2745.                 <xsl:with-param name="inPrivilegeSet" select="."/>
  2746.             </xsl:call-template>
  2747.             
  2748.             <!--Selected Extended Privileges-->
  2749.             <xsl:call-template name="SelectedExtendedPrivileges">
  2750.                 <xsl:with-param name="inPrivilegeSet" select="."/>
  2751.             </xsl:call-template>
  2752.             
  2753.             <xsl:choose>
  2754.                 <xsl:when test="generate-id(.) != generate-id(/FMPReport/File/PrivilegesCatalog/Privilege[last()])">
  2755.                     <br/>
  2756.                 </xsl:when>
  2757.             </xsl:choose>
  2758.         </xsl:for-each>
  2759.     </xsl:template>
  2760.     
  2761.     <xsl:template name="GetAccessType">
  2762.         <xsl:param name="inAccessType"/>
  2763.         <xsl:choose>
  2764.             <xsl:when test="'ViewOnly' = $inAccessType">
  2765.                 <xsl:value-of select="$valViewOnly"/>
  2766.             </xsl:when>
  2767.             <xsl:when test="'CreateEdit' = $inAccessType">
  2768.                 <xsl:value-of select="$valCreateEdit"/>
  2769.             </xsl:when>
  2770.             <xsl:when test="'CreateEditDelete' = $inAccessType">
  2771.                 <xsl:value-of select="$valCreateEditDelete"/>
  2772.             </xsl:when>
  2773.             <xsl:when test="'Modifiable' = $inAccessType">
  2774.                 <xsl:value-of select="$valModifiable"/>
  2775.             </xsl:when>
  2776.                 <xsl:when test="'NoAccess' = $inAccessType">
  2777.                 <xsl:value-of select="$valNoAccess"/>
  2778.             </xsl:when>
  2779.             <xsl:when test="'Custom' = $inAccessType">
  2780.                 <xsl:value-of select="$valCustom"/>
  2781.             </xsl:when>
  2782.             <xsl:when test="'ExecutableOnly' = $inAccessType">
  2783.                 <xsl:value-of select="$valExecutableOnly"/>
  2784.             </xsl:when>
  2785.         </xsl:choose>
  2786.     </xsl:template>
  2787.     
  2788.     <xsl:template name="TablePrivileges">
  2789.         <xsl:param name="inTableList"/>
  2790.         <table borderColor="#cccccc" cellSpacing="1" cellPadding="1" width="100%" border="1">
  2791.             <tbody>
  2792.                 <tr class="limitedPSchartheadings">
  2793.                     <td width="18%">
  2794.                         <strong><xsl:value-of select="$valTableName"/></strong>
  2795.                     </td>
  2796.                     <td width="18%">
  2797.                         <strong><xsl:value-of select="$valView"/></strong>
  2798.                     </td>
  2799.                     <td width="14%">
  2800.                         <strong><xsl:value-of select="$valEdit"/></strong>
  2801.                     </td>
  2802.                     <td width="14%">
  2803.                         <strong><xsl:value-of select="$valCreate"/></strong>
  2804.                     </td>
  2805.                     <td width="14%">
  2806.                         <strong><xsl:value-of select="$valDelete"/></strong>
  2807.                     </td>
  2808.                     <td width="22%">
  2809.                         <strong><xsl:value-of select="$valFieldAccess"/></strong>
  2810.                     </td>
  2811.                 </tr>
  2812.                 <xsl:for-each select="$inTableList/BaseTable">
  2813.                     <!--SORTBYNAME-->
  2814.                     <!--<xsl:sort select="@name"/>-->
  2815.                     <tr class="regularcharttext" vAlign="top">
  2816.                         <td>
  2817.                             <xsl:call-template name="BaseTableReference">
  2818.                                 <xsl:with-param name="inBaseTable" select="@name"/>
  2819.                             </xsl:call-template>
  2820.                         </td>
  2821.                         <td>
  2822.                             <xsl:call-template name="GetAccessValue">
  2823.                                 <xsl:with-param name="inAccess" select="View"/>
  2824.                             </xsl:call-template>
  2825.                         </td>
  2826.                         <td>
  2827.                             <xsl:call-template name="GetAccessValue">
  2828.                                 <xsl:with-param name="inAccess" select="Edit"/>
  2829.                             </xsl:call-template>
  2830.                         </td>
  2831.                         <td>
  2832.                             <xsl:call-template name="GetAccessValue">
  2833.                                 <xsl:with-param name="inAccess" select="Create"/>
  2834.                             </xsl:call-template>
  2835.                         </td>
  2836.                         <td>
  2837.                             <xsl:call-template name="GetAccessValue">
  2838.                                 <xsl:with-param name="inAccess" select="Delete"/>
  2839.                             </xsl:call-template>
  2840.                         </td>
  2841.                         <td>
  2842.                             <xsl:call-template name="FieldAccess">
  2843.                                 <xsl:with-param name="inAccess" select="FieldAccess"/>
  2844.                             </xsl:call-template>
  2845.                         </td>
  2846.                     </tr>
  2847.                 </xsl:for-each>
  2848.             </tbody>
  2849.         </table>
  2850.     </xsl:template>
  2851.     
  2852.     <xsl:template name="LayoutPrivileges">
  2853.         <xsl:param name="inLayoutList"/>
  2854.         <table borderColor="#cccccc" cellSpacing="1" cellPadding="1" width="100%" border="1">
  2855.             <tbody>
  2856.                 <tr class="limitedPSchartheadings">
  2857.                     <td width="27%">
  2858.                         <strong><xsl:value-of select="$valLayoutName"/></strong>
  2859.                     </td>
  2860.                     <td width="27%">
  2861.                         <strong><xsl:value-of select="$valLayoutAccess"/></strong>
  2862.                     </td>
  2863.                     <td width="17%">
  2864.                         <strong><xsl:value-of select="$valDataAccess"/></strong>
  2865.                     </td>
  2866.                     <td width="29%">
  2867.                         <strong><xsl:value-of select="$valAssociatedTableOccurrence"/></strong>
  2868.                     </td>
  2869.                 </tr>
  2870.                 <xsl:for-each select="$inLayoutList/Layout">
  2871.                     <!--SORTBYNAME-->
  2872.                     <!--<xsl:sort select="@name"/>-->
  2873.                     <tr class="regularcharttext" vAlign="top">
  2874.                         <td>
  2875.                             <xsl:call-template name="LayoutReference">
  2876.                                 <xsl:with-param name="inLayout" select="."/>
  2877.                             </xsl:call-template>
  2878.                         </td>
  2879.                         <td>
  2880.                             <xsl:call-template name="GetAccessType">
  2881.                                 <xsl:with-param name="inAccessType" select="LayoutAccess/@value"/>
  2882.                             </xsl:call-template>
  2883.                         </td>
  2884.                         <td>
  2885.                             <xsl:call-template name="GetAccessType">
  2886.                                 <xsl:with-param name="inAccessType" select="DataAccess/@value"/>
  2887.                             </xsl:call-template>
  2888.                         </td>                        
  2889.                         <td>
  2890.                             <xsl:variable name="layoutName" select="@name"/>
  2891.                             <xsl:variable name="layoutID" select="@id"/>
  2892.                             <xsl:call-template name="TableAliasReference">
  2893.                                 <xsl:with-param name="inTableAlias" select="/FMPReport/File/LayoutCatalog/Layout[@name = $layoutName and @id = $layoutID]/Table"/>
  2894.                             </xsl:call-template>
  2895.                         </td>
  2896.                     </tr>
  2897.                 </xsl:for-each>
  2898.             </tbody>
  2899.         </table>
  2900.     </xsl:template>
  2901.     
  2902.     <xsl:template name="ValueListPrivileges">
  2903.         <xsl:param name="inValueListList"/>
  2904.         <table borderColor="#cccccc" cellSpacing="1" cellPadding="1" width="100%" border="1">
  2905.             <tbody>
  2906.                 <tr class="limitedPSchartheadings">
  2907.                     <td>
  2908.                         <strong><xsl:value-of select="$valValueListName"/></strong>
  2909.                     </td>
  2910.                     <td>
  2911.                         <strong><xsl:value-of select="$valValueListAccess"/></strong>
  2912.                     </td>
  2913.                 </tr>
  2914.                 <xsl:for-each select="$inValueListList/ValueList">
  2915.                     <!--SORTBYNAME-->
  2916.                     <!--<xsl:sort select="@name"/>-->
  2917.                     <tr class="regularcharttext" vAlign="top">
  2918.                         <td>
  2919.                             <xsl:call-template name="VLReference">
  2920.                                 <xsl:with-param name="inVL" select="."/>
  2921.                             </xsl:call-template>
  2922.                         </td>
  2923.                         <td>
  2924.                             <xsl:call-template name="GetAccessType">
  2925.                                 <xsl:with-param name="inAccessType" select="Access/@value"/>
  2926.                             </xsl:call-template>
  2927.                         </td>
  2928.                     </tr>
  2929.                 </xsl:for-each>
  2930.             </tbody>
  2931.         </table>
  2932.     </xsl:template>
  2933.     
  2934.     <xsl:template name="ScriptPrivileges">
  2935.         <xsl:param name="inScriptList"/>
  2936.         <table borderColor="#cccccc" cellSpacing="1" cellPadding="1" width="100%" border="1">
  2937.             <tbody>
  2938.                 <tr class="limitedPSchartheadings">
  2939.                     <td>
  2940.                         <strong><xsl:value-of select="$valScriptName"/></strong>
  2941.                     </td>
  2942.                     <td>
  2943.                         <strong><xsl:value-of select="$valScriptAccess"/></strong>
  2944.                     </td>
  2945.                     <td>
  2946.                         <strong><xsl:value-of select="$valNotes"/></strong>
  2947.                     </td>
  2948.                 </tr>
  2949.                 <xsl:for-each select="$inScriptList/Script">
  2950.                     <!--SORTBYNAME-->
  2951.                     <!--<xsl:sort select="@name"/>-->
  2952.                     <tr class="regularcharttext" vAlign="top">
  2953.                         <td>
  2954.                             <xsl:call-template name="ScriptReference">
  2955.                                 <xsl:with-param name="inScript" select="."/>
  2956.                             </xsl:call-template>
  2957.                         </td>
  2958.                         <td>
  2959.                             <xsl:call-template name="GetAccessType">
  2960.                                 <xsl:with-param name="inAccessType" select="Access/@value"/>
  2961.                             </xsl:call-template>
  2962.                         </td>                        
  2963.                         <td>
  2964.                             <xsl:if test="@runFullAccess = 'True'">
  2965.                                 <xsl:value-of select="$valRunScriptFullAccess"/>
  2966.                             </xsl:if>
  2967.                         </td>
  2968.                     </tr>
  2969.                 </xsl:for-each>
  2970.             </tbody>
  2971.         </table>
  2972.     </xsl:template>
  2973.     
  2974.     <xsl:template name="FieldAccess">        
  2975.         <xsl:param name="inAccess"/>
  2976.         <xsl:call-template name="GetAccessValue">
  2977.             <xsl:with-param name="inAccess" select="$inAccess"/>
  2978.         </xsl:call-template>
  2979.         <xsl:if test="$inAccess/FieldList">
  2980.             <ul>
  2981.                 <xsl:for-each select="$inAccess/FieldList/Field">    
  2982.                     <li>
  2983.                         <xsl:call-template name="FieldDefinitionReference">
  2984.                             <xsl:with-param name="inFieldDefinition" select="."/>
  2985.                         </xsl:call-template>    
  2986.                         <xsl:text>: </xsl:text>
  2987.                         <xsl:call-template name="GetAccessType">
  2988.                             <xsl:with-param name="inAccessType" select="@accessRestriction"/>
  2989.                         </xsl:call-template>                
  2990.                     </li>
  2991.                 </xsl:for-each>
  2992.             </ul>
  2993.         </xsl:if>        
  2994.     </xsl:template>
  2995.     
  2996.     <xsl:template name="GetAccessValue">
  2997.         <xsl:param name="inAccess"/>
  2998.         <xsl:choose>
  2999.             <xsl:when test="$inAccess/@value = 'True'">
  3000.                 <xsl:value-of select="$valYes"/>
  3001.             </xsl:when>
  3002.             <xsl:when test="$inAccess/@value = 'False'">
  3003.                 <xsl:value-of select="$valNo"/>
  3004.             </xsl:when>
  3005.             <xsl:when test="$inAccess/@value = 'Limited'">
  3006.                 <p><xsl:value-of select="$valLimited"/></p>
  3007.                 <xsl:if test="$inAccess/DisplayCalculation">
  3008.                     <p><xsl:value-of select="concat($valCalculation, ':')"/></p>
  3009.                     <p>
  3010.                         <xsl:call-template name="GenerateCalc">
  3011.                             <xsl:with-param name="inDisplayCalc" select="$inAccess/DisplayCalculation"/>
  3012.                         </xsl:call-template>
  3013.                     </p>
  3014.                 </xsl:if>
  3015.             </xsl:when>
  3016.             <xsl:when test="$inAccess/@value = 'All'">
  3017.                 <xsl:value-of select="$valAll"/>
  3018.             </xsl:when>
  3019.             <xsl:when test="$inAccess/@value = 'NoAccess'">
  3020.                 <xsl:value-of select="$valNone"/>
  3021.             </xsl:when>
  3022.         </xsl:choose>
  3023.     </xsl:template>
  3024.     
  3025.     <xsl:template name="PrivilegeMenu">
  3026.         <xsl:param name="inMenu"/>
  3027.         <xsl:choose>
  3028.             <xsl:when test="$inMenu = 'All'">
  3029.                 <xsl:value-of select="$valAll"/>
  3030.             </xsl:when>
  3031.             <xsl:when test="$inMenu = 'EditOnly'">
  3032.                 <xsl:value-of select="$valEditingOnly"/>
  3033.             </xsl:when>
  3034.             <xsl:when test="$inMenu = 'Minimal'">
  3035.                 <xsl:value-of select="$valMinimal"/>
  3036.             </xsl:when>
  3037.         </xsl:choose>
  3038.     </xsl:template>
  3039.     
  3040.     <xsl:template name="OtherPrivileges">
  3041.         <xsl:param name="inPrivilegeSet"/>
  3042.         <table width="95%" border="1">
  3043.             <tbody>
  3044.                 <tr vAlign="top">
  3045.                     <td class="chartsubheads" colSpan="5">
  3046.                         <xsl:value-of select="$valOtherPrivileges"/>
  3047.                     </td>
  3048.                 </tr>
  3049.                 <tr vAlign="top">
  3050.                     <td class="chartheadersnobg" width="34%">
  3051.                         <xsl:value-of select="$valAllowPrinting"/>
  3052.                     </td>
  3053.                     <td class="regularcharttext" width="13%">
  3054.                         <xsl:call-template name="GetState">
  3055.                             <xsl:with-param name="inValue" select="$inPrivilegeSet/@printing"/>
  3056.                         </xsl:call-template>
  3057.                     </td>
  3058.                     <td class="regularcharttext" width="53%">
  3059.                     </td>
  3060.                 </tr>
  3061.                 <tr vAlign="top">
  3062.                     <td class="chartheadersnobg" width="34%">
  3063.                         <xsl:value-of select="$valAllowExporting"/>
  3064.                     </td>
  3065.                     <td class="regularcharttext" width="13%">
  3066.                         <xsl:call-template name="GetState">
  3067.                             <xsl:with-param name="inValue" select="$inPrivilegeSet/@exporting"/>
  3068.                         </xsl:call-template>
  3069.                     </td>
  3070.                     <td class="regularcharttext" width="53%">
  3071.                     </td>
  3072.                 </tr>
  3073.                 <tr vAlign="top">
  3074.                     <td class="chartheadersnobg" width="34%">
  3075.                         <xsl:value-of select="$valManageExtPrivileges"/>
  3076.                     </td>
  3077.                     <td class="regularcharttext" width="13%">
  3078.                         <xsl:call-template name="GetState">
  3079.                             <xsl:with-param name="inValue" select="$inPrivilegeSet/@managedExtended"/>
  3080.                         </xsl:call-template>
  3081.                     </td>
  3082.                     <td class="regularcharttext" width="53%">
  3083.                     </td>
  3084.                 </tr>
  3085.                 <tr vAlign="top">
  3086.                     <td class="chartheadersnobg" width="34%">
  3087.                         <xsl:value-of select="$valAllowDataValidation"/>
  3088.                     </td>
  3089.                     <td class="regularcharttext" width="13%">
  3090.                         <xsl:call-template name="GetState">
  3091.                             <xsl:with-param name="inValue" select="$inPrivilegeSet/@overrideValidationWarning"/>
  3092.                         </xsl:call-template>
  3093.                     </td>
  3094.                     <td class="regularcharttext" width="53%">
  3095.                     </td>
  3096.                 </tr>
  3097.                 <tr vAlign="top">
  3098.                     <td class="chartheadersnobg" width="34%">
  3099.                         <xsl:value-of select="$valDisconnectFromFMServer"/>
  3100.                     </td>
  3101.                     <td class="regularcharttext" width="13%">
  3102.                         <xsl:call-template name="GetState">
  3103.                             <xsl:with-param name="inValue" select="$inPrivilegeSet/@idleDisconnect"/>
  3104.                         </xsl:call-template>
  3105.                     </td>
  3106.                     <td class="regularcharttext" width="53%">
  3107.                     </td>
  3108.                 </tr>
  3109.                 <tr vAlign="top">
  3110.                     <td class="chartheadersnobg" width="34%">
  3111.                         <xsl:value-of select="$valAllowModifyPassword"/>
  3112.                     </td>
  3113.                     <td class="regularcharttext" width="13%">
  3114.                         <xsl:call-template name="GetState">
  3115.                             <xsl:with-param name="inValue" select="$inPrivilegeSet/@allowModifyPassword"/>
  3116.                         </xsl:call-template>                        
  3117.                     </td>
  3118.                     <td class="regularcharttext" width="53%">
  3119.                         <xsl:if test="$inPrivilegeSet/@passwordExpiry or $inPrivilegeSet/@passwordMinLength">
  3120.                             <ul>
  3121.                                 <xsl:if test="$inPrivilegeSet/@passwordExpiry">
  3122.                                     <li>
  3123.                                         <xsl:value-of select="concat($valExpiraryDate,': ', $inPrivilegeSet/@passwordExpiry,' ',$valDays)"/>
  3124.                                     </li>
  3125.                                 </xsl:if>
  3126.                                 <xsl:if test="$inPrivilegeSet/@passwordMinLength">
  3127.                                     <li>
  3128.                                         <xsl:value-of select="concat($valMinPasswordLength,': ', $inPrivilegeSet/@passwordMinLength,' ',$valCharacters)"/>
  3129.                                     </li>
  3130.                                 </xsl:if>
  3131.                             </ul>
  3132.                         </xsl:if>
  3133.                     </td>
  3134.                 </tr>
  3135.                 <tr vAlign="top">
  3136.                     <td class="chartheadersnobg" width="34%">
  3137.                         <xsl:value-of select="$valAvailableMenuCommands"/>
  3138.                     </td>
  3139.                     <td class="regularcharttext" width="13%">
  3140.                         <xsl:call-template name="PrivilegeMenu">
  3141.                             <xsl:with-param name="inMenu" select="$inPrivilegeSet/@menu"/>
  3142.                         </xsl:call-template>
  3143.                     </td>
  3144.                     <td class="regularcharttext" width="53%">
  3145.                     </td>
  3146.                 </tr>
  3147.             </tbody>
  3148.         </table>
  3149.     </xsl:template>
  3150.     
  3151.     <xsl:template name="SelectedExtendedPrivileges">
  3152.         <xsl:param name="inPrivilegeSet"/>                
  3153.         <xsl:variable name="extendedPrivileges" select="/FMPReport/File/ExtendedPrivilegeCatalog/ExtendedPrivilege[PrivilegeSetList/PrivilegeSet/@name = $inPrivilegeSet/@name]"/>        
  3154.         <xsl:if test="count($extendedPrivileges) > 0">
  3155.             <table width="95%" border="1">
  3156.                 <tbody>
  3157.                     <tr vAlign="top">
  3158.                         <td class="chartsubheads" colSpan="4">
  3159.                             <xsl:value-of select="$valExtendedPrivileges"/>
  3160.                         </td>
  3161.                     </tr>
  3162.                     <xsl:for-each select="$extendedPrivileges">
  3163.                         <!--SORTBYNAME-->
  3164.                         <!--<xsl:sort select="@name"/>-->
  3165.                         <tr vAlign="top">
  3166.                             <td class="regularcharttext">
  3167.                                 <xsl:call-template name="ExtendedPrivilegeReference">
  3168.                                     <xsl:with-param name="inExtendedPrivilege" select="."/>
  3169.                                 </xsl:call-template>
  3170.                             </td>
  3171.                         </tr>
  3172.                     </xsl:for-each>
  3173.                 </tbody>
  3174.             </table>
  3175.         </xsl:if>
  3176.     </xsl:template>
  3177.     
  3178.     <!--Extended Privileges -->
  3179.     <xsl:template name="Table-ExtendedPrivilegeCatalog" match="ExtendedPrivilegeCatalog">
  3180.         <p>
  3181.             <span class="partheading">
  3182.                 <xsl:call-template name="AnchorPoint">
  3183.                     <xsl:with-param name="inAnchor" select="concat($valExtendedPrivileges, $kAnchorSection)"/>
  3184.                     <xsl:with-param name="inDisplayText" select="$valExtendedPrivileges"/>
  3185.                 </xsl:call-template>                
  3186.             </span>
  3187.         </p>
  3188.         
  3189.         <table width="95%" border="1">
  3190.             <tbody>
  3191.                 <tr class="chartheaders" vAlign="top">
  3192.                     <td width="16%">
  3193.                         <xsl:value-of select="$valKeyword"/>
  3194.                     </td>
  3195.                     <td width="50%">
  3196.                         <xsl:value-of select="$valDescription"/>
  3197.                     </td>
  3198.                     <td width="34%">
  3199.                         <xsl:value-of select="$valPrivilegeSet"/>
  3200.                     </td>
  3201.                 </tr>
  3202.                 <xsl:for-each select="ExtendedPrivilege">
  3203.                     <!--SORTBYNAME-->
  3204.                     <!--<xsl:sort select="@name"/>-->
  3205.                     <tr class="regularcharttext" vAlign="top">
  3206.                         <td>
  3207.                             <xsl:call-template name="ExtendedPrivilegeAnchor">
  3208.                                 <xsl:with-param name="inExtendedPrivilege" select="."/>
  3209.                             </xsl:call-template>
  3210.                         </td>
  3211.                         <td>
  3212.                             <xsl:value-of select="@comment"/>
  3213.                         </td>
  3214.                         <td>
  3215.                             <xsl:if test="PrivilegeSetList">
  3216.                                 <ul>
  3217.                                     <xsl:for-each select="PrivilegeSetList/PrivilegeSet">
  3218.                                         <!--SORTBYNAME-->
  3219.                                         <!--<xsl:sort select="@name"/>-->
  3220.                                         <li>
  3221.                                             <xsl:call-template name="PrivilegeSetReference">
  3222.                                                 <xsl:with-param name="inPrivilegeSetName" select="@name"/>
  3223.                                             </xsl:call-template>
  3224.                                         </li>
  3225.                                     </xsl:for-each>
  3226.                                 </ul>
  3227.                             </xsl:if>
  3228.                         </td>
  3229.                     </tr>
  3230.                 </xsl:for-each>
  3231.             </tbody>
  3232.         </table>
  3233.     </xsl:template>
  3234.     
  3235.     <!--User Account -->
  3236.     <xsl:template name="Table-AccountCatalog" match="AccountCatalog">
  3237.         <p>
  3238.             <span class="partheading">
  3239.                 <xsl:call-template name="AnchorPoint">
  3240.                     <xsl:with-param name="inAnchor" select="concat($valAccounts, $kAnchorSection)"/>
  3241.                     <xsl:with-param name="inDisplayText" select="$valAccounts"/>
  3242.                 </xsl:call-template>                
  3243.             </span>
  3244.         </p>
  3245.         <table width="95%" border="1">
  3246.             <tbody>
  3247.                 <tr class="chartheaders" vAlign="top">
  3248.                     <td width="12%">
  3249.                         <xsl:value-of select="$valAccountName"/>
  3250.                     </td>
  3251.                     <td width="13%">
  3252.                         <xsl:value-of select="$valPassword"/>
  3253.                     </td>
  3254.                     <td width="9%">
  3255.                         <xsl:value-of select="$valStatus"/>
  3256.                     </td>
  3257.                     <td width="6%">
  3258.                         <xsl:value-of select="$valType"/>
  3259.                     </td>
  3260.                     <td width="15%">
  3261.                         <xsl:value-of select="$valPrivilegeSet"/>
  3262.                     </td>
  3263.                     <td width="15%">
  3264.                         <xsl:value-of select="$valDescription"/>
  3265.                     </td>
  3266.                     <td width="27%">
  3267.                         <xsl:value-of select="$valChangePassword"/>
  3268.                     </td>
  3269.                 </tr>
  3270.                 <xsl:for-each select="Account">
  3271.                     <!--SORTBYNAME-->
  3272.                     <!--<xsl:sort select="@name"/>-->
  3273.                     <tr class="regularcharttext">
  3274.                         <td>
  3275.                             <xsl:call-template name="AccountAnchor">
  3276.                                 <xsl:with-param name="inAccount" select="."/>
  3277.                             </xsl:call-template>
  3278.                         </td>                        
  3279.                         <td>
  3280.                             <xsl:if test="@emptyPassword = 'False'">
  3281.                                 <xsl:value-of select="'*********'"/>
  3282.                             </xsl:if>
  3283.                         </td>
  3284.                         <td>
  3285.                             <xsl:call-template name="AccountStatus">
  3286.                                 <xsl:with-param name="inStatus" select="@status"/>
  3287.                             </xsl:call-template>
  3288.                         </td>
  3289.                         <td>
  3290.                             <xsl:call-template name="AccountType">
  3291.                                 <xsl:with-param name="inAccountType" select="@managedBy"/>
  3292.                             </xsl:call-template>
  3293.                         </td>
  3294.                         <td>
  3295.                             <xsl:call-template name="PrivilegeSetReference">
  3296.                                 <xsl:with-param name="inPrivilegeSetName" select="@privilegeSet"/>
  3297.                             </xsl:call-template>
  3298.                         </td>
  3299.                         <td>
  3300.                             <xsl:value-of select="Description"/>
  3301.                         </td>
  3302.                         <td>
  3303.                             <xsl:if test="@changePasswordOnNextLogin">                            
  3304.                                 <xsl:call-template name="GetState">
  3305.                                     <xsl:with-param name="inValue" select="@changePasswordOnNextLogin"/>
  3306.                                 </xsl:call-template>
  3307.                             </xsl:if>
  3308.                         </td>
  3309.                     </tr>
  3310.                 </xsl:for-each>
  3311.             </tbody>
  3312.         </table>
  3313.     </xsl:template>
  3314.  
  3315.     <xsl:template name="AccountStatus">
  3316.         <xsl:param name="inStatus"/>
  3317.         <xsl:choose>
  3318.             <xsl:when test="$inStatus = 'Active'">
  3319.                 <xsl:value-of select="$valActive"/>
  3320.             </xsl:when>
  3321.             <xsl:when test="$inStatus = 'Inactive'">
  3322.                 <xsl:value-of select="$valInactive"/>
  3323.             </xsl:when>
  3324.         </xsl:choose>
  3325.     </xsl:template>
  3326.     
  3327.     <xsl:template name="AccountType">
  3328.         <xsl:param name="inAccountType"/>
  3329.         <xsl:choose>
  3330.             <xsl:when test="$inAccountType = 'FileMaker'">
  3331.                 <xsl:value-of select="$valFileMaker"/>
  3332.             </xsl:when>
  3333.             <xsl:when test="$inAccountType = 'External'">
  3334.                 <xsl:value-of select="$valExternalServer"/>
  3335.             </xsl:when>
  3336.         </xsl:choose>
  3337.     </xsl:template>
  3338.     
  3339.     <!--File reference-->
  3340.     <xsl:template name="Table-FileReferenceCatalog" match="FileReferenceCatalog">
  3341.         <p>
  3342.             <span class="partheading">
  3343.                 <xsl:call-template name="AnchorPoint">
  3344.                     <xsl:with-param name="inAnchor" select="concat($valFileReferences, $kAnchorSection)"/>
  3345.                     <xsl:with-param name="inDisplayText" select="$valFileReferences"/>
  3346.                 </xsl:call-template>                
  3347.             </span>
  3348.         </p>
  3349.         <table width="100%" border="1" cellSpacing="1" cellPadding="1">
  3350.             <tbody>
  3351.                 <tr class="chartheaders" vAlign="top">
  3352.                     <td width="22%">
  3353.                         <xsl:value-of select="$valFileReference"/>
  3354.                     </td>
  3355.                     <td width="78%">
  3356.                         <xsl:value-of select="$valPathList"/>
  3357.                     </td>
  3358.                 </tr>
  3359.                 <xsl:for-each select="FileReference">
  3360.                     <!--SORTBYNAME-->
  3361.                     <!--<xsl:sort select="@name"/>-->
  3362.                     <tr class="regularcharttext" vAlign="top">
  3363.                         <td>
  3364.                             <xsl:call-template name="FileRefAnchor">
  3365.                                 <xsl:with-param name="inFileReference" select="."/>
  3366.                             </xsl:call-template>
  3367.                         </td>
  3368.                         <td>
  3369.                             <xsl:value-of select="@pathList"/>
  3370.                         </td>
  3371.                     </tr>
  3372.                 </xsl:for-each>
  3373.             </tbody>
  3374.         </table>
  3375.     </xsl:template>
  3376.     
  3377.     <!--Custom Function-->
  3378.     <xsl:template name="Table-CustomFunctionCatalog" match="CustomFunctionCatalog">
  3379.         <p>
  3380.             <span class="partheading">
  3381.                 <xsl:call-template name="AnchorPoint">
  3382.                     <xsl:with-param name="inAnchor" select="concat($valCustomFunctions, $kAnchorSection)"/>
  3383.                     <xsl:with-param name="inDisplayText" select="$valCustomFunctions"/>
  3384.                 </xsl:call-template>    
  3385.             </span>
  3386.         </p>
  3387.         <table width="100%" border="1" cellSpacing="1" cellPadding="1">
  3388.             <tbody>
  3389.                 <tr class="chartheaders" vAlign="top">
  3390.                     <td width="18%">
  3391.                         <xsl:value-of select="$valFunctionName"/>
  3392.                     </td>
  3393.                     <td width="18%">
  3394.                         <xsl:value-of select="$valParameters"/>
  3395.                     </td>
  3396.                     <td width="18%">
  3397.                         <xsl:value-of select="$valAvailability"/>
  3398.                     </td>
  3399.                     <td width="20%">
  3400.                         <xsl:value-of select="$valDefinition"/>
  3401.                     </td>
  3402.                     <td width="18%">
  3403.                         <xsl:value-of select="$valInFieldDefinitions"/>
  3404.                     </td>
  3405.                     <td width="18%">
  3406.                         <xsl:value-of select="$valInScripts"/>
  3407.                     </td>
  3408.                 </tr>
  3409.                 <xsl:for-each select="CustomFunction">
  3410.                     <!--SORTBYNAME-->
  3411.                     <!--<xsl:sort select="@name"/>-->
  3412.                     <tr class="regularcharttext" vAlign="top">
  3413.                         <td>
  3414.                             <xsl:call-template name="CustomFunctionAnchor">
  3415.                                 <xsl:with-param name="inCustomFunction" select="."/>
  3416.                             </xsl:call-template>
  3417.                         </td>
  3418.                         <td>
  3419.                             <xsl:value-of select="@parameters"/>
  3420.                         </td>                        
  3421.                         <td>
  3422.                             <xsl:choose>
  3423.                                 <xsl:when test="@visible = 'True'">
  3424.                                     <xsl:value-of select="$valAllAccounts"/>
  3425.                                 </xsl:when>
  3426.                                 <xsl:otherwise>
  3427.                                     <xsl:value-of select="$valOnlyAccountsFullPrivilege"/>
  3428.                                 </xsl:otherwise>
  3429.                             </xsl:choose>
  3430.                         </td>                        
  3431.                         <td>
  3432.                             <xsl:call-template name="GenerateCalc">
  3433.                                 <xsl:with-param name="inDisplayCalc" select="DisplayCalculation"/>
  3434.                             </xsl:call-template>
  3435.                         </td>
  3436.                         
  3437.                         <!--References to field defintion-->                        
  3438.                         <xsl:variable name="customFuncName" select="@name"/>
  3439.                         <td>
  3440.                             <xsl:variable name="fieldDefList" select="/FMPReport/File/BaseTableCatalog/BaseTable/FieldCatalog/Field[DisplayCalculation/Chunk[@type = 'CustomFunctionRef' and text() = $customFuncName] or AutoEnter/DisplayCalculation/Chunk[@type = 'CustomFunctionRef' and text() = $customFuncName] or Validation/DisplayCalculation/Chunk[@type = 'CustomFunctionRef' and text() = $customFuncName]]"/>
  3441.                             <ul>
  3442.                                 <xsl:for-each select="$fieldDefList">
  3443.                                     <li>
  3444.                                         <xsl:call-template name="FieldDefinitionReference">
  3445.                                             <xsl:with-param name="inFieldDefinition" select="."/>
  3446.                                         </xsl:call-template>
  3447.                                     </li>
  3448.                                 </xsl:for-each>
  3449.                             </ul>
  3450.                         </td>                        
  3451.                         <td>
  3452.                             <xsl:variable name="scriptList" select="/FMPReport/File/ScriptCatalog/Script[*/*//Chunk[@type = 'CustomFunctionRef' and text() = $customFuncName]]"/>
  3453.                             <xsl:if test="$scriptList">
  3454.                                 <ul>
  3455.                                     <xsl:for-each select="$scriptList">
  3456.                                         <!--SORTBYNAME-->
  3457.                                         <!--<xsl:sort select="@name"/>-->
  3458.                                         <li>
  3459.                                             <xsl:call-template name="ScriptReference">
  3460.                                                 <xsl:with-param name="inScript" select="."/>
  3461.                                             </xsl:call-template>
  3462.                                         </li>
  3463.                                     </xsl:for-each>
  3464.                                 </ul>
  3465.                             </xsl:if>
  3466.                         </td>
  3467.                     </tr>
  3468.                 </xsl:for-each>
  3469.             </tbody>
  3470.         </table>
  3471.     </xsl:template>
  3472.     
  3473.     <xsl:template name="Table-ValueListCatalog" match="ValueListCatalog">
  3474.         <p>
  3475.             <span class="partheading">
  3476.                 <xsl:call-template name="AnchorPoint">
  3477.                     <xsl:with-param name="inAnchor" select="concat($valValueLists, $kAnchorSection)"/>
  3478.                     <xsl:with-param name="inDisplayText" select="$valValueLists"/>
  3479.                 </xsl:call-template>                
  3480.             </span>
  3481.         </p>
  3482.         <table width="95%" border="1">
  3483.             <tbody>
  3484.                 <tr class="chartheaders" vAlign="top">
  3485.                     <td width="20%">
  3486.                         <xsl:value-of select="$valValueListName"/>
  3487.                     </td>
  3488.                     <td width="19%">
  3489.                         <xsl:value-of select="$valSource"/>
  3490.                     </td>
  3491.                     <td width="36%">
  3492.                         <xsl:value-of select="$valValues"/>
  3493.                     </td>
  3494.                     <td width="25%">
  3495.                         <xsl:value-of select="$valOnLayouts"/>
  3496.                     </td>
  3497.                 </tr>
  3498.                 <xsl:for-each select="ValueList">
  3499.                     <!--SORTBYNAME-->
  3500.                     <!--<xsl:sort select="@name"/>-->
  3501.                     <tr class="regularcharttext">
  3502.                         <td>
  3503.                             <xsl:call-template name="VLAnchor">
  3504.                                 <xsl:with-param name="inVL" select="."/>
  3505.                             </xsl:call-template>
  3506.                         </td>
  3507.                         <td>
  3508.                             <xsl:call-template name="VLSource">
  3509.                                 <xsl:with-param name="inSourceValue" select="Source/@value"/>
  3510.                             </xsl:call-template>
  3511.                         </td>
  3512.                         <td>
  3513.                             <ul>
  3514.                                 <xsl:if test="CustomValues">
  3515.                                     <li>
  3516.                                         <xsl:call-template name="ReplaceString">
  3517.                                             <xsl:with-param name="inputString" select="CustomValues/Text"/>
  3518.                                             <xsl:with-param name="findString" select="' '"/>
  3519.                                             <xsl:with-param name="replaceString" select="', '"/>
  3520.                                         </xsl:call-template>                                        
  3521.                                     </li>
  3522.                                 </xsl:if>
  3523.                                 <xsl:if test="PrimaryField">
  3524.                                     <li>
  3525.                                         <xsl:value-of select="concat($valField,': ')"/>
  3526.                                         <xsl:call-template name="FieldReference-ShowTableAlias">
  3527.                                             <xsl:with-param name="inField" select="PrimaryField/Field"/>
  3528.                                         </xsl:call-template>
  3529.                                     </li>
  3530.                                 </xsl:if>
  3531.                                 <xsl:if test="SecondaryField">
  3532.                                     <li>
  3533.                                         <xsl:value-of select="concat($valField,': ')"/>
  3534.                                         <xsl:call-template name="FieldReference-ShowTableAlias">
  3535.                                             <xsl:with-param name="inField" select="SecondaryField/Field"/>
  3536.                                         </xsl:call-template>
  3537.                                     </li>
  3538.                                 </xsl:if>
  3539.                                 <xsl:if test="ShowRelated/@value = 'True'">
  3540.                                     <li>
  3541.                                         <xsl:value-of select="concat($valTableOccurrence,': ')"/>
  3542.                                         <xsl:call-template name="TableAliasReferenceGivenName">
  3543.                                             <xsl:with-param name="inTableAliasName" select="ShowRelated/Table/@name"/>
  3544.                                         </xsl:call-template>
  3545.                                     </li>
  3546.                                 </xsl:if>
  3547.                                 <xsl:if test="External">
  3548.                                     <li>
  3549.                                         <xsl:value-of select="concat($valFileReference, ': ')"/>
  3550.                                         <xsl:call-template name="FileRefReference">
  3551.                                             <xsl:with-param name="inFileReference" select="External/FileReference"/>                                            
  3552.                                         </xsl:call-template>
  3553.                                     </li>
  3554.                                     <li>
  3555.                                         <xsl:value-of select="concat($valValueList, ': ')"/>
  3556.                                         <xsl:call-template name="ExternalVLReference">
  3557.                                             <xsl:with-param name="inExternalVL" select="External/ValueList"/>
  3558.                                             <xsl:with-param name="inFileRef" select="External/FileReference"/>    
  3559.                                         </xsl:call-template>
  3560.                                     </li>
  3561.                                 </xsl:if>
  3562.                             </ul>
  3563.                         </td>
  3564.                         <td>
  3565.                             <ul>
  3566.                                 <xsl:variable name="valuelistName" select="@name"/>                                
  3567.                                 <xsl:for-each select="/FMPReport/File/LayoutCatalog/Layout[Object/FieldObj/DDRInfo/ValueList[@name = $valuelistName]]">
  3568.                                     <!--SORTBYNAME-->
  3569.                                     <!--<xsl:sort select="@name"/>-->
  3570.                                     <li>
  3571.                                         <xsl:call-template name="LayoutReference">
  3572.                                             <xsl:with-param name="inLayout" select="."/>
  3573.                                         </xsl:call-template>
  3574.                                     </li>
  3575.                                 </xsl:for-each>
  3576.                             </ul>
  3577.                         </td>
  3578.                     </tr>
  3579.                 </xsl:for-each>
  3580.             </tbody>
  3581.         </table>
  3582.     </xsl:template>
  3583.     
  3584.     <xsl:template name="VLSource">
  3585.         <xsl:param name="inSourceValue"/>
  3586.         <xsl:choose>
  3587.             <xsl:when test="$inSourceValue = 'Field'">
  3588.                 <xsl:value-of select="$valField"/>
  3589.             </xsl:when>
  3590.             <xsl:when test="$inSourceValue = 'Custom'">
  3591.                 <xsl:value-of select="$valCustom"/>
  3592.             </xsl:when>
  3593.             <xsl:when test="$inSourceValue = 'External'">
  3594.                 <xsl:value-of select="$valExternal"/>
  3595.             </xsl:when>
  3596.         </xsl:choose>
  3597.     </xsl:template>
  3598.     
  3599.     <!--Script Catalog-->
  3600.     <xsl:template name="Table-ScriptCatalog" match="ScriptCatalog">
  3601.         <p>
  3602.             <span class="partheading">
  3603.                 <xsl:call-template name="AnchorPoint">
  3604.                     <xsl:with-param name="inAnchor" select="concat($valScripts, $kAnchorSection)"/>
  3605.                     <xsl:with-param name="inDisplayText" select="$valScripts"/>
  3606.                 </xsl:call-template>                    
  3607.             </span>
  3608.         </p>
  3609.         <xsl:for-each select="Script">
  3610.             <!--SORTBYNAME-->
  3611.             <!--<xsl:sort select="@name"/>-->
  3612.             <xsl:call-template name="Table-Script"/>
  3613.         </xsl:for-each>                    
  3614.     </xsl:template>
  3615.     
  3616.     <!--Script-->
  3617.     <xsl:template name="Table-Script">
  3618.         <table width="100%" border="1">
  3619.             <tbody>
  3620.                 <tr class="privsetfirst" vAlign="top">
  3621.                     <td width="35%">
  3622.                         <xsl:value-of select="$valScriptName"/>
  3623.                     </td>
  3624.                     <td width="65%">
  3625.                         <xsl:call-template name="ScriptAnchor">
  3626.                             <xsl:with-param name="inScript" select="."/>
  3627.                         </xsl:call-template>
  3628.                     </td>
  3629.                 </tr>
  3630.                 <tr vAlign="top">
  3631.                     <td class="chartheadersnobg">
  3632.                         <xsl:value-of select="$valRunScriptFullAccess"/>
  3633.                     </td>
  3634.                     <td class="regularcharttext">
  3635.                         <xsl:call-template name="GetState">
  3636.                             <xsl:with-param name="inValue" select="@runFullAccess"/>
  3637.                         </xsl:call-template>
  3638.                     </td>
  3639.                 </tr>
  3640.                 <xsl:variable name="scriptId" select="@id"/>
  3641.                 <xsl:variable name="scriptName" select="@name"/>
  3642.                 <tr vAlign="top">
  3643.                     <td class="chartheadersnobg">
  3644.                         <xsl:value-of select="$valLayoutsUseThisScript"/>
  3645.                     </td>
  3646.                     <td class="regularcharttext">
  3647.                         <ul>                                                                            
  3648.                             <xsl:for-each select="/FMPReport/File/LayoutCatalog/Layout[Object/GroupButtonObj/Step/Script[@name = $scriptName and @id = $scriptId]]">
  3649.                                 <!--SORTBYNAME-->
  3650.                                 <!--<xsl:sort select="@name"/>-->
  3651.                                 <li>
  3652.                                     <xsl:call-template name="LayoutReference">
  3653.                                         <xsl:with-param name="inLayout" select="."/>
  3654.                                     </xsl:call-template>
  3655.                                 </li>                                
  3656.                             </xsl:for-each>            
  3657.                         </ul>
  3658.                     </td>
  3659.                 </tr>
  3660.                 <tr vAlign="top">
  3661.                     <td class="chartheadersnobg">
  3662.                         <xsl:value-of select="$valScriptsUseThisScript"/>
  3663.                     </td>
  3664.                     <td class="regularcharttext">
  3665.                         <ul>                            
  3666.                             <xsl:for-each select="/FMPReport/File/ScriptCatalog/Script[StepList/Step/Script[@name = $scriptName and @id=$scriptId]]">
  3667.                                 <!--SORTBYNAME-->
  3668.                                 <!--<xsl:sort select="@name"/>-->
  3669.                                 <li>
  3670.                                     <xsl:call-template name="ScriptReference">
  3671.                                         <xsl:with-param name="inScript" select="."/>
  3672.                                     </xsl:call-template>
  3673.                                 </li>                                
  3674.                             </xsl:for-each>            
  3675.                         </ul>
  3676.                     </td>
  3677.                 </tr>
  3678.                 <tr vAlign="top">
  3679.                     <td class="chartsubheads" colSpan="2">
  3680.                         <xsl:value-of select="$valScriptDefinition"/>
  3681.                     </td>
  3682.                 </tr>
  3683.                 <tr vAlign="top">
  3684.                     <td class="chartheadersnobg">
  3685.                         <xsl:value-of select="$valScriptSteps"/>
  3686.                     </td>
  3687.                     <td class="regularcharttext">
  3688.                         <ul>
  3689.                             <xsl:for-each select="StepList/Step">
  3690.                                 <li>
  3691.                                     <xsl:value-of select="StepText"/>
  3692.                                 </li>
  3693.                             </xsl:for-each>
  3694.                         </ul>
  3695.                     </td>
  3696.                 </tr>
  3697.                 <xsl:variable name="fieldList" select="StepList/Step//Field"/>
  3698.                 <tr vAlign="top">
  3699.                     <td class="chartheadersnobg">
  3700.                         <xsl:value-of select="$valFieldsUsedInScript"/>
  3701.                     </td>
  3702.                     <td class="regularcharttext">
  3703.                         <ul>
  3704.                             <xsl:for-each select="$fieldList">
  3705.                                 <!--SORTBYNAME-->
  3706.                                 <!--<xsl:sort select="@name"/>-->
  3707.                                 <xsl:variable name="field" select="."/>
  3708.                                 <xsl:if test="generate-id($fieldList[(@name = $field/@name) and (@table = $field/@table)][1]) = generate-id(.)">
  3709.                                     <li>
  3710.                                         <xsl:call-template name="FieldReference-ShowTableAlias">
  3711.                                             <xsl:with-param name="inField" select="."/>
  3712.                                         </xsl:call-template>
  3713.                                     </li>
  3714.                                 </xsl:if>
  3715.                             </xsl:for-each>
  3716.                         </ul>
  3717.                     </td>
  3718.                 </tr>    
  3719.                     <tr vAlign="top">
  3720.                     <td class="chartheadersnobg">
  3721.                         <xsl:value-of select="$valScriptsUsedInScript"/>
  3722.                     </td>
  3723.                     <td class="regularcharttext">
  3724.                         <ul>
  3725.                             <xsl:variable name="scriptList" select="StepList/Step//Script"/>
  3726.                             <xsl:for-each select="$scriptList">    
  3727.                                 <!--SORTBYNAME-->                            
  3728.                                 <!--<xsl:sort select="@name"/>-->
  3729.                                 <xsl:variable name="script" select="."/>
  3730.                                 <xsl:if test="generate-id($scriptList[(@name = $script/@name) and (@id = $script/@id)][1]) = generate-id(.)">
  3731.                                     <li>
  3732.                                         <xsl:variable name="fileRef" select="preceding-sibling::UniversalPathList"/>
  3733.                                         <xsl:choose>
  3734.                                             <xsl:when test="$fileRef">
  3735.                                                 <xsl:call-template name="ExternalScriptReference">
  3736.                                                     <xsl:with-param name="inFileRef" select="$fileRef"/>
  3737.                                                     <xsl:with-param name="inScript" select="$script"/>
  3738.                                                 </xsl:call-template>
  3739.                                             </xsl:when>
  3740.                                             <xsl:otherwise>
  3741.                                                 <xsl:call-template name="ScriptReference">
  3742.                                                     <xsl:with-param name="inScript" select="$script"/>
  3743.                                                 </xsl:call-template>
  3744.                                             </xsl:otherwise>
  3745.                                         </xsl:choose>
  3746.                                     </li>
  3747.                                 </xsl:if>                            
  3748.                             </xsl:for-each>
  3749.                         </ul>
  3750.                     </td>
  3751.                 </tr>            
  3752.                 <tr vAlign="top">
  3753.                     <td class="chartheadersnobg">
  3754.                         <xsl:value-of select="$valLayoutsUsedInScript"/>
  3755.                     </td>
  3756.                     <td class="regularcharttext">
  3757.                         <ul>
  3758.                             <xsl:variable name="layoutList" select="StepList/Step//Layout"/>
  3759.                             <xsl:for-each select="$layoutList">
  3760.                                 <!--SORTBYNAME-->
  3761.                                 <!--<xsl:sort select="@name"/>-->
  3762.                                 <xsl:variable name="layout" select="."/>
  3763.                                 <xsl:if test="generate-id($layoutList[(@name = $layout/@name) and (@id = $layout/@id)][1]) = generate-id(.)">
  3764.                                     <li>
  3765.                                         <xsl:call-template name="LayoutReference">
  3766.                                             <xsl:with-param name="inLayout" select="."/>
  3767.                                         </xsl:call-template>
  3768.                                     </li>
  3769.                                 </xsl:if>
  3770.                             </xsl:for-each>
  3771.                         </ul>
  3772.                     </td>
  3773.                 </tr>
  3774.  
  3775.                 <tr vAlign="top">
  3776.                     <td class="chartheadersnobg">
  3777.                         <xsl:value-of select="$valTablesUsedInScript"/>
  3778.                     </td>
  3779.                     <td class="regularcharttext">
  3780.                         <ul>                            
  3781.                             <xsl:for-each select="$fieldList">                                
  3782.                                 <xsl:sort select="key('BaseTable-TableAliasIndex',@table)[1]/@baseTable"/>                                
  3783.                                 <xsl:variable name="field" select="."/>
  3784.                                 <xsl:variable name="uniqueFieldList" select="$fieldList[@table = $field/@table]"/>
  3785.                                 
  3786.                                 <xsl:if test="generate-id(.) = generate-id($uniqueFieldList[1])">                                    
  3787.                                     <!--sort according to base table names!!-->
  3788.                                     
  3789.                                     <xsl:variable name="tableAlias" select="/FMPReport/File/RelationshipGraph/TableList/Table[@name = $field/@table]"/>                                
  3790.                                     <xsl:if test="generate-id($fieldList[
  3791.                                                                             (@name = $field/@name) 
  3792.                                                                             and (key('BaseTable-TableAliasIndex',@table)[1]/@baseTable = $tableAlias/@baseTable)
  3793.                                                                             and (string(key('BaseTable-TableAliasIndex',@table)[1]/FileReference/@name) = string($tableAlias/FileReference/@name))
  3794.                                                                             
  3795.                                                                         ][1]) = generate-id(.)">
  3796.                                         <li>
  3797.                                             <xsl:call-template name="BaseTableRefGivenTableAlias">
  3798.                                                 <xsl:with-param name="inTableAlias" select="$tableAlias"/>
  3799.                                             </xsl:call-template>
  3800.                                         </li>
  3801.                                     </xsl:if>
  3802.                                 </xsl:if>
  3803.                             </xsl:for-each>
  3804.                         </ul>
  3805.                     </td>
  3806.                 </tr>
  3807.                 <tr vAlign="top">
  3808.                     <td class="chartheadersnobg">
  3809.                         <xsl:value-of select="$valTableOccurrencesUsedInScript"/>
  3810.                     </td>
  3811.                     <td class="regularcharttext">
  3812.                         <ul>
  3813.                             <xsl:for-each select="$fieldList">                                
  3814.                                 <xsl:sort select="@table"/>
  3815.                                 <xsl:variable name="field" select="."/>
  3816.                                 <xsl:if test="generate-id($fieldList[@table = $field/@table][1]) = generate-id(.)">
  3817.                                     <xsl:variable name="tableOccurrence" select="key('BaseTable-TableAliasIndex',$field/@table)"/>
  3818.                                     <xsl:if test="$tableOccurrence">
  3819.                                         <li>
  3820.                                             <xsl:call-template name="TableAliasReference">
  3821.                                                 <xsl:with-param name="inTableAlias" select="$tableOccurrence"/>
  3822.                                             </xsl:call-template>
  3823.                                         </li>
  3824.                                     </xsl:if>
  3825.                                 </xsl:if>                            
  3826.                             </xsl:for-each>
  3827.                         </ul>
  3828.                     </td>
  3829.                 </tr>            
  3830.                 <tr vAlign="top">
  3831.                     <td class="chartheadersnobg">
  3832.                         <xsl:value-of select="$valCustomFunctionsUsedInScript"/>
  3833.                     </td>
  3834.                     <td class="regularcharttext">
  3835.                         <ul>
  3836.                             <xsl:variable name="chunkList" select="StepList/Step/*//Chunk[@type = 'CustomFunctionRef']"/>
  3837.                             <xsl:for-each select="$chunkList">
  3838.                                 <!--Sort according to function name!!-->
  3839.                                 <!--SORTBYNAME-->
  3840.                                 <!--<xsl:sort select="text()"/>-->
  3841.                                 <xsl:variable name="chunk" select="."/>
  3842.                                 <!--Remove duplicates-->
  3843.                                 <xsl:if test="generate-id($chunkList[text() = $chunk/text()][1]) = generate-id(.)">
  3844.                                     <li>
  3845.                                         <xsl:call-template name="CustomFunctionReference">
  3846.                                             <xsl:with-param name="inCustomFunctionName" select="$chunk/text()"/>
  3847.                                         </xsl:call-template>
  3848.                                     </li>
  3849.                                 </xsl:if>
  3850.                             </xsl:for-each>                            
  3851.                         </ul>
  3852.                     </td>
  3853.                 </tr>            
  3854.             </tbody>
  3855.         </table>
  3856.     </xsl:template>
  3857.     
  3858.     <!--Don't do anything, already handled-->
  3859.     <xsl:template name="Options" match="Options">
  3860.     </xsl:template>
  3861.     
  3862.     <xsl:template name="Language">
  3863.         <xsl:param name="inLang"/>
  3864.         <xsl:choose>
  3865.             <xsl:when test="$inLang = 'Unicode_Raw'">
  3866.                 <xsl:value-of select="$valUnicode_Raw"/>
  3867.             </xsl:when>
  3868.             <xsl:when test="$inLang = 'Unicode_Standard'">
  3869.                 <xsl:value-of select="$valUnicode_Standard"/>
  3870.             </xsl:when>
  3871.             <xsl:when test="$inLang = 'Catalog'">
  3872.                 <xsl:value-of select="$valCatalog"/>
  3873.             </xsl:when>
  3874.             <xsl:when test="$inLang = 'Catalan'">
  3875.                 <xsl:value-of select="$valCatalan"/>
  3876.             </xsl:when>
  3877.             <xsl:when test="$inLang = 'Croatian'">
  3878.                 <xsl:value-of select="$valCroatian"/>
  3879.             </xsl:when>
  3880.             <xsl:when test="$inLang = 'Czech'">
  3881.                 <xsl:value-of select="$valCzech"/>
  3882.             </xsl:when>
  3883.             <xsl:when test="$inLang = 'Danish'">
  3884.                 <xsl:value-of select="$valDanish"/>
  3885.             </xsl:when>
  3886.             <xsl:when test="$inLang = 'Dutch'">
  3887.                 <xsl:value-of select="$valDutch"/>
  3888.             </xsl:when>
  3889.             <xsl:when test="$inLang = 'Unicode_Raw'">
  3890.                 <xsl:value-of select="$valUnicode_Raw"/>
  3891.             </xsl:when>
  3892.             <xsl:when test="$inLang = 'English'">
  3893.                 <xsl:value-of select="$valEnglish"/>
  3894.             </xsl:when>
  3895.             <xsl:when test="$inLang = 'Finnish'">
  3896.                 <xsl:value-of select="$valFinnish"/>
  3897.             </xsl:when>
  3898.             <xsl:when test="$inLang = 'Finnish_Custom'">
  3899.                 <xsl:value-of select="$valFinnish_Custom"/>
  3900.             </xsl:when>    
  3901.             <xsl:when test="$inLang = 'Finnish_Custom'">
  3902.                 <xsl:value-of select="$valFinnish_Custom"/>
  3903.             </xsl:when>    
  3904.                     <xsl:when test="$inLang = 'French'">
  3905.                 <xsl:value-of select="$valFrench"/>
  3906.             </xsl:when>    
  3907.             <xsl:when test="$inLang = 'German'">
  3908.                 <xsl:value-of select="$valGerman"/>
  3909.             </xsl:when>    
  3910.             <xsl:when test="$inLang = 'German_Dictionary'">
  3911.                 <xsl:value-of select="$valGerman_Dictionary"/>
  3912.             </xsl:when>    
  3913.             <xsl:when test="$inLang = 'Greek'">
  3914.                 <xsl:value-of select="$valGreek"/>
  3915.             </xsl:when>    
  3916.             <xsl:when test="$inLang = 'Hungarian'">
  3917.                 <xsl:value-of select="$valHungarian"/>
  3918.             </xsl:when>    
  3919.             <xsl:when test="$inLang = 'Icelandic'">
  3920.                 <xsl:value-of select="$valIcelandic"/>
  3921.             </xsl:when>    
  3922.             <xsl:when test="$inLang = 'Italian'">
  3923.                 <xsl:value-of select="$valItalian"/>
  3924.             </xsl:when>    
  3925.             <xsl:when test="$inLang = 'Japanese'">
  3926.                 <xsl:value-of select="$valJapanese"/>
  3927.             </xsl:when>    
  3928.             <xsl:when test="$inLang = 'Norwegian'">
  3929.                 <xsl:value-of select="$valNorwegian"/>
  3930.             </xsl:when>    
  3931.             <xsl:when test="$inLang = 'Polish'">
  3932.                 <xsl:value-of select="$valPolish"/>
  3933.             </xsl:when>    
  3934.             <xsl:when test="$inLang = 'Portuguese'">
  3935.                 <xsl:value-of select="$valPortuguese"/>
  3936.             </xsl:when>    
  3937.             <xsl:when test="$inLang = 'Romanian'">
  3938.                 <xsl:value-of select="$valRomanian"/>
  3939.             </xsl:when>    
  3940.             <xsl:when test="$inLang = 'Russian'">
  3941.                 <xsl:value-of select="$valRussian"/>
  3942.             </xsl:when>    
  3943.             <xsl:when test="$inLang = 'Slovak'">
  3944.                 <xsl:value-of select="$valSlovak"/>
  3945.             </xsl:when>    
  3946.             <xsl:when test="$inLang = 'Slovenian'">
  3947.                 <xsl:value-of select="$valSlovenian"/>
  3948.             </xsl:when>    
  3949.             <xsl:when test="$inLang = 'Spanish'">
  3950.                 <xsl:value-of select="$valSpanish"/>
  3951.             </xsl:when>    
  3952.             <xsl:when test="$inLang = 'Spanish_Traditional'">
  3953.                 <xsl:value-of select="$valSpanish_Traditional"/>
  3954.             </xsl:when>    
  3955.             <xsl:when test="$inLang = 'Swedish'">
  3956.                 <xsl:value-of select="$valSwedish"/>
  3957.             </xsl:when>    
  3958.             <xsl:when test="$inLang = 'Swedish_Custom'">
  3959.                 <xsl:value-of select="$valSwedish_Custom"/>
  3960.             </xsl:when>    
  3961.             <xsl:when test="$inLang = 'Turkish'">
  3962.                 <xsl:value-of select="$valTurkish"/>
  3963.             </xsl:when>    
  3964.             <xsl:when test="$inLang = 'Ukranian'">
  3965.                 <xsl:value-of select="$valUkranian"/>
  3966.             </xsl:when>        
  3967.         </xsl:choose>
  3968.     </xsl:template>
  3969.     
  3970. </xsl:stylesheet>